From d2b3b0778e25760fd7b1ba841801cd1ac08e0d92 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Mon, 9 Aug 2004 19:57:51 +0000 Subject: fix probe functions (Logical change 1.26) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@131 ce84e21b-d406-0410-9b95-82705330c041 --- client/bcfg2 | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/client/bcfg2 b/client/bcfg2 index 3de6545b2..c8607a58a 100644 --- a/client/bcfg2 +++ b/client/bcfg2 @@ -12,7 +12,7 @@ from sss.ssslib import comm_lib from Debian import Debian def RunProbe(probe): - ret = Element("probe-data", name=probe.attrib['name']) + ret = Element("probe-data", name=probe.attrib['name'], source=probe.attrib['source']) script = open(mktemp(), 'w+') script.write("#!%s\n"%(probe.attrib.get('interpreter', '/bin/sh'))) script.write(probe.text) @@ -32,9 +32,11 @@ def dgetopt(arglist, opt, vopt): except GetoptError, g: print g print "bcfg2 Usage:" - for (k,v) in opt.iteritems() + vopt.iteritems(): + for (k,v) in opt.iteritems(): print " -%s %s"%(k,v) - exit(1) + for (k,v) in vopt.iteritems(): + print " -%s <%s>"%(k,v) + exit(1) for (gopt,garg) in o: option = gopt[1:] if opt.has_key(option): @@ -117,6 +119,15 @@ if __name__ == '__main__': method = getattr(toolset, "Install%s"%(entry.tag)) entrystate[entry] = method(entry) + for structure in structurestate.keys(): + if structurestate[structure]: + continue + for entry in structure.getchildren(): + entrystate[entry] = getattr(toolset, "Verify%s"%(entry.tag)) + states = map(lambda x:entrystate[x], structure.getchildren()) + if False not in states: + structurestate[structure] = True + #print entrystate print "good:", for k,v in entrystate.iteritems(): -- cgit v1.2.3-1-g7c22