summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2006-02-10 22:27:01 +0000
committerNarayan Desai <desai@mcs.anl.gov>2006-02-10 22:27:01 +0000
commit073aa424c3201b869a8a008aa09652cbc9545836 (patch)
tree6ce18133cbf3f0e82d2a61f51f871058fbb57fe4 /tools
parent65c448f49484551f2e7db5316b6dbe2b97bb0f2c (diff)
downloadbcfg2-073aa424c3201b869a8a008aa09652cbc9545836.tar.gz
bcfg2-073aa424c3201b869a8a008aa09652cbc9545836.tar.bz2
bcfg2-073aa424c3201b869a8a008aa09652cbc9545836.zip
include ricks crosscheck fix that adds support for other element types
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1728 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'tools')
-rw-r--r--tools/crosscheck.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/tools/crosscheck.py b/tools/crosscheck.py
index a32d10e2a..109a3a950 100644
--- a/tools/crosscheck.py
+++ b/tools/crosscheck.py
@@ -6,30 +6,32 @@ import sys
important = {'Package':['name', 'version'],
'Service':['name', 'status'],
'Directory':['name', 'owner', 'group', 'perms'],
- 'SymLink':['name', 'owner', 'from'],
- 'ConfigFile':['name', 'owner', 'group', 'perms']}
+ 'SymLink':['name', 'to'],
+ 'ConfigFile':['name', 'owner', 'group', 'perms'],
+ 'Permissions':['name', 'perms'],
+ 'PostInstall':['name']}
def compare(new, old):
- for i in range(2): #this is hardcoded.. may be a better looping
- method
+ for i in range(2): #this is hardcoded.. may be a better looping method
for child in new.getchildren():
- equiv = old.xpath('%s[@name="%s"]' % (child.tag,
- child.get('name')))
+ equiv = old.xpath('%s[@name="%s"]' % (child.tag, child.get('name')))
if not important.has_key(child.tag):
print "tag type %s not handled" % (child.tag)
continue
if len(equiv) == 0:
- print "didn't find matching %s %s" % (child.tag,
- child.get('name'))
+ print "didn't find matching %s %s" % (child.tag, child.get('name'))
continue
elif len(equiv) >= 1:
if child.tag == 'ConfigFile':
if child.text != equiv[0].text:
continue
- if [child.get(field) for field in
- important[child.tag]] == \
- [equiv[0].get(field) for field in
- important[child.tag]]:
+ if [child.get(field) for field in important[child.tag]] == \
+ [equiv[0].get(field) for field in important[child.tag]]:
+ new.remove(child)
+ old.remove(equiv[0])
+ else:
+ print "+", lxml.etree.tostring(child),
+ print "-", lxml.etree.tostring(equiv[0]),
if len(old.getchildren()) == 0 and len(new.getchildren()) == 0:
return True
if new.tag == 'Independant':