summaryrefslogtreecommitdiffstats
path: root/src/sbin
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2010-03-09 00:25:22 +0000
committerSol Jerome <solj@ices.utexas.edu>2010-03-09 00:25:22 +0000
commitcb6a058e89130141e12ed817d12e8aaf04a3b5eb (patch)
treecbf0acd2c1b05196c28c514b34baf556ae07aec8 /src/sbin
parentb4a76883d4971a46970aebb4ee617f3677125fc6 (diff)
downloadbcfg2-cb6a058e89130141e12ed817d12e8aaf04a3b5eb.tar.gz
bcfg2-cb6a058e89130141e12ed817d12e8aaf04a3b5eb.tar.bz2
bcfg2-cb6a058e89130141e12ed817d12e8aaf04a3b5eb.zip
bcfg2-repo-validate: Add check to verify bundle name attribute
Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5757 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/sbin')
-rwxr-xr-xsrc/sbin/bcfg2-repo-validate12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/sbin/bcfg2-repo-validate b/src/sbin/bcfg2-repo-validate
index 33c06dffd..1d16a8148 100755
--- a/src/sbin/bcfg2-repo-validate
+++ b/src/sbin/bcfg2-repo-validate
@@ -112,7 +112,7 @@ if __name__ == '__main__':
'grouppatterns': (gp_list, "%s/grouppatterns.xsd"),
}
- failures = 0
+ failures = 0
for k, (filelist, schemaname) in list(filesets.items()):
try:
schema = lxml.etree.XMLSchema(lxml.etree.parse(open(schemaname%(schemadir))))
@@ -159,5 +159,15 @@ if __name__ == '__main__':
genshibundle not in allbundles:
print("*** Warning: Bundle %s referenced, but does not "
"exist." % bundle)
+ # verify bundle name attribute matches filename
+ for bundle in (bundle_list + genshibundle_list):
+ fname = bundle.split('Bundler/')[1].split('.')[0]
+ xdata = lxml.etree.parse(bundle)
+ bname = xdata.getroot().get('name')
+ if fname != bname:
+ print("The following names are inconsistent:")
+ print(" Filename is %s" % fname)
+ print(" Bundle name found in %s is %s" % (fname, bname))
+
raise SystemExit, failures