diff options
author | Sol Jerome <solj@ices.utexas.edu> | 2010-08-13 22:09:50 +0000 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2010-08-14 21:26:25 -0500 |
commit | d4d5b89b206383b8528055186004dd6a721c2425 (patch) | |
tree | 84a855cdb052a92291f23176746c05ee2248fbd2 /src/sbin/bcfg2-repo-validate | |
parent | 0e63090ffad42698b6cb71443bbe21fd80c44d11 (diff) | |
download | bcfg2-d4d5b89b206383b8528055186004dd6a721c2425.tar.gz bcfg2-d4d5b89b206383b8528055186004dd6a721c2425.tar.bz2 bcfg2-d4d5b89b206383b8528055186004dd6a721c2425.zip |
Revert "Quick hack to fix #910"
We can achieve this behavior by setting the prefix in bcfg2.conf under
the [server] section.
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@6019 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/sbin/bcfg2-repo-validate')
-rwxr-xr-x | src/sbin/bcfg2-repo-validate | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/src/sbin/bcfg2-repo-validate b/src/sbin/bcfg2-repo-validate index a2047197c..d187441ed 100755 --- a/src/sbin/bcfg2-repo-validate +++ b/src/sbin/bcfg2-repo-validate @@ -23,14 +23,6 @@ if __name__ == '__main__': cpath = setup['configfile'] prefix = setup['prefix'] schemadir = "%s/share/bcfg2/schemas" % (prefix) - # On openSuSE the manual installation puts the schemas under - # /usr/local/share/... . On Fedora and maybe other systems the - # path is correct: /usr/share/bcfg2/schemas - # FIXME: This needs further investigation. - if os.path.isdir(schemadir): - pass - else: - schemadir = "/usr/local/share/bcfg2/schemas" os.chdir(schemadir) repo = setup['repo'] @@ -42,7 +34,7 @@ if __name__ == '__main__': if filename == 'info.xml': info_list.append(os.path.join(root, filename)) - # Get metadata list (with all included files) + # get metadata list (with all included files) metadata_list = glob.glob("%s/Metadata/groups.xml" % repo) ref_bundles = set() xdata = lxml.etree.parse("%s/Metadata/groups.xml" % repo) @@ -62,7 +54,7 @@ if __name__ == '__main__': included.add(ent) included.discard(filename) - # Check for multiple default group definitions + # check for multiple default group definitions default_groups=[] for grp in lxml.etree.parse("%s/Metadata/groups.xml" \ % repo).findall('.//Group'): @@ -73,12 +65,12 @@ if __name__ == '__main__': for grp in default_groups: print(" %s" % grp.get('name')) - # Get all XIncluded bundles + # get all XIncluded bundles xdata.xinclude() for bundle in xdata.findall("//Bundle"): ref_bundles.add("%s/Bundler/%s" % (repo, bundle.get('name'))) - # Get lists of all other xml files to validate + # get lists of all other xml files to validate clients_list = glob.glob("%s/Metadata/clients.xml" % repo) bundle_list = glob.glob("%s/Bundler/*.xml" % repo) genshibundle_list = glob.glob("%s/Bundler/*.genshi" % repo) @@ -92,7 +84,7 @@ if __name__ == '__main__': pkgcfg_list = glob.glob("%s/Packages/config.xml" % repo) gp_list = glob.glob('%s/GroupPatterns/config.xml' % repo) - # Verify attributes for configuration entries + # verify attributes for configuration entries # (as defined in doc/server/configurationentries) # TODO: See if it is possible to do this in the schema instead configuration_attrs = { @@ -125,14 +117,14 @@ if __name__ == '__main__': " Path %s in %s: %s" % (pathname, rfile, [attr for attr in required_attrs.difference(pathset)])) - # Warn on duplicate Pkgmgr entries with the same priority + # warn on duplicate Pkgmgr entries with the same priority pset = set() for plist in pkg_list: try: xdata = lxml.etree.parse(plist) except lxml.etree.XMLSyntaxError, e: print("Failed to parse %s: %s" % (plist, e)) - # Get priority, type, group + # get priority, type, group priority = xdata.getroot().get('priority') ptype = xdata.getroot().get('type') for pkg in xdata.findall("//Package"): @@ -141,7 +133,7 @@ if __name__ == '__main__': else: grp = 'none' ptuple = (pkg.get('name'), priority, ptype, grp) - # Check if package is already listed with same priority, + # check if package is already listed with same priority, # type, grp if ptuple in pset: print("Duplicate Package %s, priority:%s, type:%s"\ @@ -199,11 +191,11 @@ if __name__ == '__main__': elif verbose: print("%s checks out" % (filename)) - # Print out missing bundle information + # print out missing bundle information if verbose: print("") for bundle in ref_bundles: - # Check for both regular and genshi bundles + # check for both regular and genshi bundles xmlbundle = "%s.xml" % bundle genshibundle = "%s.genshi" % bundle allbundles = bundle_list + genshibundle_list @@ -211,7 +203,7 @@ if __name__ == '__main__': genshibundle not in allbundles: print("*** Warning: Bundle %s referenced, but does not " "exist." % bundle) - # Verify bundle name attribute matches filename + # verify bundle name attribute matches filename for bundle in (bundle_list + genshibundle_list): fname = bundle.split('Bundler/')[1].split('.')[0] xdata = lxml.etree.parse(bundle) @@ -221,4 +213,5 @@ if __name__ == '__main__': print(" Filename is %s" % fname) print(" Bundle name found in %s is %s" % (fname, bname)) + raise SystemExit, failures |