summaryrefslogtreecommitdiffstats
path: root/src/sbin/bcfg2-server
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2006-08-21 20:53:26 +0000
committerNarayan Desai <desai@mcs.anl.gov>2006-08-21 20:53:26 +0000
commit83f172afaeda2fbec7105c81950ebc3ef4ac8053 (patch)
tree69ee1d5e0a5b10a86656a0e31c5646f6e3d1110a /src/sbin/bcfg2-server
parentea78a428f3b9c3d1638d1bc1d5aa9955bfdd1b5e (diff)
downloadbcfg2-83f172afaeda2fbec7105c81950ebc3ef4ac8053.tar.gz
bcfg2-83f172afaeda2fbec7105c81950ebc3ef4ac8053.tar.bz2
bcfg2-83f172afaeda2fbec7105c81950ebc3ef4ac8053.zip
Fix probe data response code
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2078 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/sbin/bcfg2-server')
-rwxr-xr-xsrc/sbin/bcfg2-server21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/sbin/bcfg2-server b/src/sbin/bcfg2-server
index aeec85cbf..1035e5f41 100755
--- a/src/sbin/bcfg2-server
+++ b/src/sbin/bcfg2-server
@@ -144,15 +144,20 @@ class Bcfg2Serv(Bcfg2.Server.Component.Component):
def Bcfg2RecvProbeData(self, address, probedata):
'''Receive probe data from clients'''
client = self.resolve_client(address[0])
-
- for data in probedata:
- try:
- [generator] = [gen for gen in self.Core.generators if gen.__name__ == data.get('source')]
- generator.ReceiveData(client, data)
- except IndexError:
+ try:
+ xpdata = XML(probedata)
+ except:
+ self.logger.error("Failed to parse probe data from client %s" % (client))
+ return False
+
+ for data in xpdata:
+ if self.Core.Plugins.has_key(data.get('source')):
+ try:
+ self.Core.Plugins[data.get('source')].ReceiveData(client, data)
+ except:
+ self.logger.error("Failed to process probe data from client %s" % (client), exc_info=1)
+ else:
self.logger.warning("Failed to locate plugin %s" % (data.get('source')))
- except:
- critical_error('error in probe data receipt')
return True
def Bcfg2AssertProfile(self, address, profile):