summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Weiß <holger@zedat.fu-berlin.de>2011-07-05 19:55:56 +0200
committerHolger Weiß <holger@zedat.fu-berlin.de>2011-07-05 19:55:56 +0200
commit653fe9d7f8c62b812e5dbd42ab93cf72387f3ca1 (patch)
tree49c62502babc6919c0859405a9269b15ce029bbe
parent56df807da30dbdc872d9cafeb0cfc7609ff62cfa (diff)
downloadbcfg2-653fe9d7f8c62b812e5dbd42ab93cf72387f3ca1.tar.gz
bcfg2-653fe9d7f8c62b812e5dbd42ab93cf72387f3ca1.tar.bz2
bcfg2-653fe9d7f8c62b812e5dbd42ab93cf72387f3ca1.zip
bcfg2-admin compare: Handle all <Independent> tags
If the configuration specifications contain multiple <Independent> tags, compare all of them, not only the first one.
-rw-r--r--src/lib/Server/Admin/Compare.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/Server/Admin/Compare.py b/src/lib/Server/Admin/Compare.py
index 1438b6d2d..54f3750e9 100644
--- a/src/lib/Server/Admin/Compare.py
+++ b/src/lib/Server/Admin/Compare.py
@@ -105,12 +105,11 @@ class Compare(Bcfg2.Server.Admin.Mode):
else:
print("Unmatched bundle %s" % (bundle.get('name')))
rcs.append(False)
- i1 = new.find('./Independent')
- i2 = old.find('./Independent')
- if self.compareStructures(i1, i2):
- new.remove(i1)
- old.remove(i2)
- else:
+ i1 = lxml.etree.Element('Independent')
+ i2 = lxml.etree.Element('Independent')
+ i1.extend(new.findall('./Independent/*'))
+ i2.extend(old.findall('./Independent/*'))
+ if not self.compareStructures(i1, i2):
rcs.append(False)
return False not in rcs