diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2007-02-12 22:15:25 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2007-02-12 22:15:25 +0000 |
commit | 5f743cb0523f6e2bed22958d995063696be883ae (patch) | |
tree | 2a16805d54bd17be8378e6270386c143095972b8 /src/sbin/bcfg2-admin | |
parent | 46ed91ebed61fb7f46b382423c313ddce77af454 (diff) | |
download | bcfg2-5f743cb0523f6e2bed22958d995063696be883ae.tar.gz bcfg2-5f743cb0523f6e2bed22958d995063696be883ae.tar.bz2 bcfg2-5f743cb0523f6e2bed22958d995063696be883ae.zip |
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
Diffstat (limited to 'src/sbin/bcfg2-admin')
-rwxr-xr-x | src/sbin/bcfg2-admin | 16 |
1 files changed, 13 insertions, 3 deletions
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''' |