summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2011-04-08 16:31:38 -0500
committerSol Jerome <sol.jerome@gmail.com>2011-04-08 16:31:38 -0500
commit227690fca43d08f1c6cc9d19afc1013fe8f3eec0 (patch)
tree6f70d61d601ce28d660dd9358d47e53c17bbe113 /src
parent9b27384d1218cbab85612e7d162edc23ee0f5617 (diff)
downloadbcfg2-227690fca43d08f1c6cc9d19afc1013fe8f3eec0.tar.gz
bcfg2-227690fca43d08f1c6cc9d19afc1013fe8f3eec0.tar.bz2
bcfg2-227690fca43d08f1c6cc9d19afc1013fe8f3eec0.zip
repo-validate: Verify genshi bundle list
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/sbin/bcfg2-repo-validate36
1 files changed, 17 insertions, 19 deletions
diff --git a/src/sbin/bcfg2-repo-validate b/src/sbin/bcfg2-repo-validate
index 554e4f72b..a5ba24898 100755
--- a/src/sbin/bcfg2-repo-validate
+++ b/src/sbin/bcfg2-repo-validate
@@ -151,27 +151,26 @@ if __name__ == '__main__':
else:
pset.add(ptuple)
- filesets = {'metadata': (metadata_list, "%s/metadata.xsd"),
- 'clients': (clients_list, "%s/clients.xsd"),
- 'info': (info_list, "%s/info.xsd"),
- 'bundle': (bundle_list, "%s/bundle.xsd"),
- 'pkglist': (pkg_list, "%s/pkglist.xsd"),
- 'base': (base_list, "%s/base.xsd"),
- 'rules': (rules_list, "%s/rules.xsd"),
- 'imageinfo': (imageinfo_list, "%s/report-configuration.xsd"),
- 'services': (services_list, "%s/services.xsd"),
- 'deps': (deps_list, "%s/deps.xsd"),
- 'decisions': (dec_list, "%s/decisions.xsd"),
- 'packages': (pkgcfg_list, "%s/packages.xsd"),
- 'grouppatterns': (gp_list, "%s/grouppatterns.xsd"),
- }
+ filesets = {"%s/metadata.xsd": metadata_list,
+ "%s/clients.xsd": clients_list,
+ "%s/info.xsd": info_list,
+ "%s/bundle.xsd": bundle_list + genshibundle_list,
+ "%s/pkglist.xsd": pkg_list,
+ "%s/base.xsd": base_list,
+ "%s/rules.xsd": rules_list,
+ "%s/report-configuration.xsd": imageinfo_list,
+ "%s/services.xsd": services_list,
+ "%s/deps.xsd": deps_list,
+ "%s/decisions.xsd": dec_list,
+ "%s/packages.xsd": pkgcfg_list,
+ "%s/grouppatterns.xsd": gp_list}
failures = 0
- for k, (filelist, schemaname) in list(filesets.items()):
+ for schemaname, filelist in list(filesets.items()):
try:
- schema = lxml.etree.XMLSchema(lxml.etree.parse(open(schemaname%(schemadir))))
+ schema = lxml.etree.XMLSchema(lxml.etree.parse(open(schemaname % (schemadir))))
except:
- print("Failed to process schema %s" % (schemaname%(schemadir)))
+ print("Failed to process schema %s" % (schemaname % (schemadir)))
failures = 1
continue
for filename in filelist:
@@ -223,5 +222,4 @@ if __name__ == '__main__':
print(" Filename is %s" % fname)
print(" Bundle name found in %s is %s" % (fname, bname))
-
- raise SystemExit, failures
+ raise SystemExit(failures)