diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Bcfg2/Server/Core.py | 3 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/MultiprocessingCore.py | 4 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/Plugin/base.py | 5 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/Probes.py | 12 |
4 files changed, 17 insertions, 7 deletions
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) |