From 5f743cb0523f6e2bed22958d995063696be883ae Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Mon, 12 Feb 2007 22:15:25 +0000 Subject: Improve messages in bcfg2-admin compare -r git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2806 ce84e21b-d406-0410-9b95-82705330c041 --- src/sbin/bcfg2-admin | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/sbin/bcfg2-admin') diff --git a/src/sbin/bcfg2-admin b/src/sbin/bcfg2-admin index 0865f848e..2790ba17b 100755 --- a/src/sbin/bcfg2-admin +++ b/src/sbin/bcfg2-admin @@ -219,10 +219,13 @@ def do_compare(args): (oldd, newd) = args (old, new) = [os.listdir(spot) for spot in args] for item in old: - print item - do_compare([oldd + '/' + item, newd + '/' + item]) - old.remove(item) + print "Entry:", item + state = do_compare([oldd + '/' + item, newd + '/' + item]) new.remove(item) + if state: + print "Entry:", item, "good" + else: + print "Entry:", item, "bad" if new: print "new has extra entries", new return @@ -239,6 +242,7 @@ def do_compare(args): if bundle.get('name')[-4:] == '.xml': bundle.set('name', bundle.get('name')[:-4]) + rcs = [] for bundle in new.findall('./Bundle'): equiv = old.xpath('Bundle[@name="%s"]' % (bundle.get('name'))) if len(equiv) == 0: @@ -248,6 +252,9 @@ def do_compare(args): if compare(bundle, equiv[0]): new.remove(bundle) old.remove(equiv[0]) + rcs.append(True) + else: + rcs.append(False) else: print "dunno what is going on for bundle %s" % (bundle.get('name')) i1 = new.find('./Independant') @@ -255,6 +262,9 @@ def do_compare(args): if compare(i1, i2): new.remove(i1) old.remove(i2) + else: + rcs.append(False) + return not False in rcs def do_pull(client, etype, ename): '''Make currently recorded client state correct for entry''' -- cgit v1.2.3-1-g7c22