summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xredhat/scripts/bcfg2-report-collector.init2
-rw-r--r--src/lib/Bcfg2/Server/Core.py3
-rw-r--r--src/lib/Bcfg2/Server/MultiprocessingCore.py4
-rw-r--r--src/lib/Bcfg2/Server/Plugin/base.py5
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Probes.py12
-rwxr-xr-xsrc/sbin/bcfg2-yum-helper2
6 files changed, 20 insertions, 8 deletions
diff --git a/redhat/scripts/bcfg2-report-collector.init b/redhat/scripts/bcfg2-report-collector.init
index 6d1c8cab9..3c112006d 100755
--- a/redhat/scripts/bcfg2-report-collector.init
+++ b/redhat/scripts/bcfg2-report-collector.init
@@ -17,7 +17,7 @@
### END INIT INFO
# Include lsb functions
-. /etc//init.d/functions
+. /etc/init.d/functions
# Commonly used stuff
DAEMON=/usr/sbin/bcfg2-report-collector
diff --git a/src/lib/Bcfg2/Server/Core.py b/src/lib/Bcfg2/Server/Core.py
index d06277fa2..1b56099df 100644
--- a/src/lib/Bcfg2/Server/Core.py
+++ b/src/lib/Bcfg2/Server/Core.py
@@ -876,6 +876,9 @@ class BaseCore(object):
imd.query.by_name = self.build_metadata
if self.metadata_cache_mode in ['cautious', 'aggressive']:
self.metadata_cache[client_name] = imd
+ else:
+ self.logger.debug("Using cached metadata object for %s" %
+ client_name)
return imd
def process_statistics(self, client_name, statistics):
diff --git a/src/lib/Bcfg2/Server/MultiprocessingCore.py b/src/lib/Bcfg2/Server/MultiprocessingCore.py
index f67161fc5..b690242f8 100644
--- a/src/lib/Bcfg2/Server/MultiprocessingCore.py
+++ b/src/lib/Bcfg2/Server/MultiprocessingCore.py
@@ -235,7 +235,7 @@ class ChildCore(BaseCore):
# make the return connection before dispatching the actual
# RPC call so that the parent is blocking for a connection
# as briefly as possible
- self.logger.error("Connecting to parent via %s" % address)
+ self.logger.debug("Connecting to parent via %s" % address)
client = Client(address)
method, args, kwargs = data
rv = None
@@ -253,7 +253,7 @@ class ChildCore(BaseCore):
method))
if address is not None:
# if the key is None, then no response is expected
- self.logger.error("Returning data to parent via %s" % address)
+ self.logger.debug("Returning data to parent via %s" % address)
client.send(rv)
def _block(self):
diff --git a/src/lib/Bcfg2/Server/Plugin/base.py b/src/lib/Bcfg2/Server/Plugin/base.py
index c825a57b5..244c73aa8 100644
--- a/src/lib/Bcfg2/Server/Plugin/base.py
+++ b/src/lib/Bcfg2/Server/Plugin/base.py
@@ -34,9 +34,6 @@ class Debuggable(object):
:returns: bool - The new value of the debug flag
"""
self.debug_flag = debug
- self.debug_log("%s: debug = %s" % (self.__class__.__name__,
- self.debug_flag),
- flag=True)
return debug
def toggle_debug(self):
@@ -136,6 +133,8 @@ class Plugin(Debuggable):
self.running = False
def set_debug(self, debug):
+ self.debug_log("%s: debug = %s" % (self.name, self.debug_flag),
+ flag=True)
for entry in self.Entries.values():
if isinstance(entry, Debuggable):
entry.set_debug(debug)
diff --git a/src/lib/Bcfg2/Server/Plugins/Probes.py b/src/lib/Bcfg2/Server/Plugins/Probes.py
index 8c552a90b..bf59809f7 100644
--- a/src/lib/Bcfg2/Server/Plugins/Probes.py
+++ b/src/lib/Bcfg2/Server/Plugins/Probes.py
@@ -298,14 +298,19 @@ class Probes(Bcfg2.Server.Plugin.Probing,
elif pdata.tag == 'Group':
self.cgroups[client.get('name')].append(pdata.get('name'))
+ if self.core.metadata_cache_mode in ['cautious', 'aggressive']:
+ self.core.metadata_cache.expire()
+
def _load_data_db(self, client=None):
""" Load probe data from the database """
- self.probedata = {}
- self.cgroups = {}
if client is None:
+ self.probedata = {}
+ self.cgroups = {}
probedata = ProbesDataModel.objects.all()
groupdata = ProbesGroupsModel.objects.all()
else:
+ self.probedata.pop(client, None)
+ self.cgroups.pop(client, None)
probedata = ProbesDataModel.objects.filter(hostname=client)
groupdata = ProbesGroupsModel.objects.filter(hostname=client)
@@ -319,6 +324,9 @@ class Probes(Bcfg2.Server.Plugin.Probing,
self.cgroups[pgroup.hostname] = []
self.cgroups[pgroup.hostname].append(pgroup.group)
+ if self.core.metadata_cache_mode in ['cautious', 'aggressive']:
+ self.core.metadata_cache.expire(client)
+
@Bcfg2.Server.Plugin.track_statistics()
def GetProbes(self, meta):
return self.probes.get_probe_data(meta)
diff --git a/src/sbin/bcfg2-yum-helper b/src/sbin/bcfg2-yum-helper
index b8c99953d..49baeb9c3 100755
--- a/src/sbin/bcfg2-yum-helper
+++ b/src/sbin/bcfg2-yum-helper
@@ -262,6 +262,8 @@ class CacheManager(YumHelper):
self.yumbase.repos.populateSack(mdtype='metadata', cacheonly=1)
self.yumbase.repos.populateSack(mdtype='filelists', cacheonly=1)
self.yumbase.repos.populateSack(mdtype='otherdata', cacheonly=1)
+ # this does something with the groups cache as a side effect
+ self.yumbase.comps # pylint: disable=W0104
def main():