summaryrefslogtreecommitdiffstats
path: root/src/sbin/bcfg2-repo-validate
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2006-04-19 18:42:51 +0000
committerNarayan Desai <desai@mcs.anl.gov>2006-04-19 18:42:51 +0000
commitb7d449933ccf4bb00342f33aa00aba87de442eac (patch)
tree0f1b47305f5113a4f80760c687417e90078b5606 /src/sbin/bcfg2-repo-validate
parentdd9b0b2ecbe0e6bcef23314a0e41184e380b674a (diff)
downloadbcfg2-b7d449933ccf4bb00342f33aa00aba87de442eac.tar.gz
bcfg2-b7d449933ccf4bb00342f33aa00aba87de442eac.tar.bz2
bcfg2-b7d449933ccf4bb00342f33aa00aba87de442eac.zip
Return non-zero return codes if any errors occur
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1843 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/sbin/bcfg2-repo-validate')
-rw-r--r--src/sbin/bcfg2-repo-validate6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sbin/bcfg2-repo-validate b/src/sbin/bcfg2-repo-validate
index ba5a02f61..6361ec0c2 100644
--- a/src/sbin/bcfg2-repo-validate
+++ b/src/sbin/bcfg2-repo-validate
@@ -33,6 +33,7 @@ if __name__ == '__main__':
'imageinfo':("%s/etc/reports.xml", "%s/report-configuration.xsd"),
'services':("%s/Svcmgr/*.xml", "%s/services.xsd")}
+ failures = 0
for k, (spec, schemaname) in filesets.iteritems():
try:
if verbose:
@@ -40,6 +41,7 @@ if __name__ == '__main__':
schema = lxml.etree.XMLSchema(lxml.etree.parse(open(schemaname%(schemadir))))
except:
print "Failed to process schema %s" % (schemaname%(schemadir))
+ failures += 1
continue
for filename in glob.glob(spec%(repo)):
try:
@@ -47,9 +49,11 @@ if __name__ == '__main__':
except SyntaxError:
print "%s ***FAILS*** to parse \t\t<----" % (filename)
os.system("xmllint %s" % filename)
+ failures += 1
continue
except IOError:
print "Failed to open file %s \t\t<---" % (filename)
+ failures += 1
continue
if schema.validate(datafile):
if verbose:
@@ -57,3 +61,5 @@ if __name__ == '__main__':
else:
print "%s ***FAILS*** to verify \t\t<----" % (filename)
os.system("xmllint --schema %s %s" % (schemaname % schemadir, filename))
+ failures += 1
+ raise SystemExit, failures