summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/MultiprocessingCore.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-08-05 14:50:23 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-08-05 14:51:45 -0400
commitcb8b6e95e010ae322cb6be9b79e1a89009f45948 (patch)
tree43f5491fd3d1c5d6d02a22ca89ec83d124c06c13 /src/lib/Bcfg2/Server/MultiprocessingCore.py
parentdd97411cd650bfc157a7835ed9b859f5def5abb0 (diff)
downloadbcfg2-cb8b6e95e010ae322cb6be9b79e1a89009f45948.tar.gz
bcfg2-cb8b6e95e010ae322cb6be9b79e1a89009f45948.tar.bz2
bcfg2-cb8b6e95e010ae322cb6be9b79e1a89009f45948.zip
Multiprocessing: proxy RecvProbeData calls
This proxies RecvProbeData calls to child cores to expire the probe cache. The probe data itself is not relayed, just the fact that there was probe data received from a given client. Fixes #129.
Diffstat (limited to 'src/lib/Bcfg2/Server/MultiprocessingCore.py')
-rw-r--r--src/lib/Bcfg2/Server/MultiprocessingCore.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/Bcfg2/Server/MultiprocessingCore.py b/src/lib/Bcfg2/Server/MultiprocessingCore.py
index 4c304d28c..8031c69d4 100644
--- a/src/lib/Bcfg2/Server/MultiprocessingCore.py
+++ b/src/lib/Bcfg2/Server/MultiprocessingCore.py
@@ -291,6 +291,13 @@ class ChildCore(BaseCore):
self.metadata_cache.expire(client)
@exposed
+ def RecvProbeData(self, address, _):
+ """ Expire the probe cache for a client """
+ if 'Probes' in self.plugins:
+ client = self.resolve_client(address, metadata=False)
+ self.plugins['Probes'].load_data(client)
+
+ @exposed
def GetConfig(self, client):
""" Render the configuration for a client """
self.logger.debug("%s: Building configuration for %s" %
@@ -389,6 +396,14 @@ class Core(BuiltinCore):
return BuiltinCore.set_debug(self, address, debug)
@exposed
+ def RecvProbeData(self, address, probedata):
+ rv = BuiltinCore.RecvProbeData(self, address, probedata)
+ # we don't want the children to actually process probe data,
+ # so we don't send the data, just the fact that we got some.
+ self.rpc_q.publish("RecvProbeData", args=[address, None])
+ return rv
+
+ @exposed
def GetConfig(self, address):
client = self.resolve_client(address)[0]
childname = self.children.next()