diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/ValidateBcfg2Repo | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/tools/ValidateBcfg2Repo b/tools/ValidateBcfg2Repo deleted file mode 100644 index 9ebdac59c..000000000 --- a/tools/ValidateBcfg2Repo +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python - -from glob import glob -from sys import argv, exit -from validate import validate, ValidationException -from ConfigParser import ConfigParser - -if __name__ == '__main__': - cf = ConfigParser() - cf.read(['/etc/bcfgd.conf']) - try: - repo = cf.get('server', 'repository') - except: - if len(argv) == 1: - print "Usage: validate_repo <repo directory>" - raise SystemExit, 1 - repo = argv[1] - if len(argv) == 3: - schemadir = argv[2] - else: - schemadir = '/usr/share/bcfg2/schemas' - - # add more validation as more schemas get written - filesets = {'metadata':("%s/etc/metadata.xml", "%s/metadata.xsd"), - 'bundle':("%s/Bundler/*.xml", "%s/bundle.xsd"), - 'pkglist':("%s/Pkgmgr/*.xml", "%s/pkglist.xsd"), - 'base':("%s/etc/base.xml", "%s/base.xsd"), - 'imageinfo':("%s/etc/imageinfo.xml", "%s/translation.xsd"), - 'services':("%s/etc/services.xml", "%s/services.xsd")} - - for k, (spec, schema) in filesets.iteritems(): - for filename in glob(spec%(repo)): - try: - validate(open(filename).read(), schema%(schemadir)) - print "%s checks out"%(filename) - except ValidationException, v: - print "file %s fails to verify:\n%s"%(filename, v) - except IOError: - print "failed to open file %s"%(filename) |