summaryrefslogtreecommitdiffstats
path: root/src/sbin/bcfg2-repo-validate
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2007-01-16 15:27:05 +0000
committerNarayan Desai <desai@mcs.anl.gov>2007-01-16 15:27:05 +0000
commit8340206111ea2375589ea78ccb2142de21d292c0 (patch)
tree33fd94774e75a0715681b20571eadea645ed65a1 /src/sbin/bcfg2-repo-validate
parent01bf54f6f65c0e9172f786afaed7abad5d92d6c1 (diff)
downloadbcfg2-8340206111ea2375589ea78ccb2142de21d292c0.tar.gz
bcfg2-8340206111ea2375589ea78ccb2142de21d292c0.tar.bz2
bcfg2-8340206111ea2375589ea78ccb2142de21d292c0.zip
Finish validation fixes for xinclude schemas
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2680 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/sbin/bcfg2-repo-validate')
-rwxr-xr-xsrc/sbin/bcfg2-repo-validate16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/sbin/bcfg2-repo-validate b/src/sbin/bcfg2-repo-validate
index ab835f0a1..203a5556a 100755
--- a/src/sbin/bcfg2-repo-validate
+++ b/src/sbin/bcfg2-repo-validate
@@ -20,8 +20,6 @@ if __name__ == '__main__':
prefix = cf.get('server', 'prefix')
except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
prefix = '/usr'
- if verbose:
- print "Using installation prefix %s" % (prefix)
schemadir = "%s/share/bcfg2/schemas" % (prefix)
os.chdir(schemadir)
@@ -44,8 +42,6 @@ if __name__ == '__main__':
failures = 0
for k, (spec, schemaname) in filesets.iteritems():
try:
- if verbose:
- print "Processing schema %s" % (schemaname % (schemadir))
schema = lxml.etree.XMLSchema(lxml.etree.parse(open(schemaname%(schemadir))))
except:
print "Failed to process schema %s" % (schemaname%(schemadir))
@@ -67,7 +63,13 @@ if __name__ == '__main__':
if verbose:
print "%s checks out" % (filename)
else:
- print "%s ***FAILS*** to verify \t\t<----" % (filename)
- os.system("xmllint --xinclude --schema %s %s" % (schemaname % schemadir, filename))
- failures = 1
+ rc = os.system("xmllint --noout --xinclude --schema %s %s > /dev/null 2>/dev/null" % \
+ (schemaname % schemadir, filename))
+ if rc:
+ failures = 1
+ print "%s ***FAILS*** to verify \t\t<----" % (filename)
+ os.system("xmllint --noout --xinclude --schema %s %s" % \
+ (schemaname % schemadir, filename))
+ elif verbose:
+ print "%s checks out" % (filename)
raise SystemExit, failures