summaryrefslogtreecommitdiffstats
path: root/src/sbin/bcfg2-repo-validate
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2008-08-04 13:19:23 +0000
committerSol Jerome <solj@ices.utexas.edu>2008-08-04 13:19:23 +0000
commit92dab211c527abec849b5f16a994962e9816cf5f (patch)
tree6611ee311320673feda16a5ef8c3cfe7be35e5c3 /src/sbin/bcfg2-repo-validate
parent4597031f28922b680fb67e522790aae01d8a9984 (diff)
downloadbcfg2-92dab211c527abec849b5f16a994962e9816cf5f.tar.gz
bcfg2-92dab211c527abec849b5f16a994962e9816cf5f.tar.bz2
bcfg2-92dab211c527abec849b5f16a994962e9816cf5f.zip
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
Diffstat (limited to 'src/sbin/bcfg2-repo-validate')
-rwxr-xr-xsrc/sbin/bcfg2-repo-validate19
1 files changed, 10 insertions, 9 deletions
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