From 92dab211c527abec849b5f16a994962e9816cf5f Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Mon, 4 Aug 2008 13:19:23 +0000 Subject: Force schema checks for all info.xml files. git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4847 ce84e21b-d406-0410-9b95-82705330c041 --- src/sbin/bcfg2-repo-validate | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/sbin/bcfg2-repo-validate') diff --git a/src/sbin/bcfg2-repo-validate b/src/sbin/bcfg2-repo-validate index a1166e82a..ee5d74487 100755 --- a/src/sbin/bcfg2-repo-validate +++ b/src/sbin/bcfg2-repo-validate @@ -1,6 +1,9 @@ #!/usr/bin/env python -'''bcfg2-repo-validate checks all xml files in Bcfg2 repos against their respective XML schemas''' +''' +bcfg2-repo-validate checks all xml files in Bcfg2 +repos against their respective XML schemas +''' __revision__ = '$Revision$' import glob, lxml.etree, os, sys @@ -21,15 +24,12 @@ if __name__ == '__main__': os.chdir(schemadir) repo = setup['repo'] - ''' - Get a list of all info.xml files - in Cfg directory and subdirectories - ''' + # Get a list of all info.xml files in the bcfg2 repository info_list = [] - for root, dirs, files in os.walk('%s/Cfg' % repo): - for filename in files: + for root, dirs, files in os.walk('%s' % repo): + for filename in files: if filename.endswith('info.xml'): - info_list.append(os.path.join(root, filename)) + info_list.append(os.path.join(root, filename)) # get lists of all other xml files to validate metadata_list = glob.glob("%s/Metadata/groups.xml" % repo) @@ -77,7 +77,8 @@ if __name__ == '__main__': if verbose: print "%s checks out" % (filename) else: - rc = os.system("xmllint --noout --xinclude --schema %s %s > /dev/null 2>/dev/null" % \ + rc = os.system("xmllint --noout --xinclude --schema \ + %s %s > /dev/null 2>/dev/null" % \ (schemaname % schemadir, filename)) if rc: failures = 1 -- cgit v1.2.3-1-g7c22