From af03b573c55a8239c26236769bb5fd4e2a01a0f6 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Fri, 14 Jul 2006 22:38:02 +0000 Subject: Patch of Jos to add server installation prefix support git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1953 ce84e21b-d406-0410-9b95-82705330c041 --- src/sbin/bcfg2-repo-validate | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/sbin/bcfg2-repo-validate b/src/sbin/bcfg2-repo-validate index 6d91dda01..67ebf12f1 100644 --- a/src/sbin/bcfg2-repo-validate +++ b/src/sbin/bcfg2-repo-validate @@ -6,16 +6,22 @@ __revision__ = '$Revision$' import glob, lxml.etree, os, sys, ConfigParser if __name__ == '__main__': - cf = ConfigParser.ConfigParser() - schemadir = '/usr/share/bcfg2/schemas' verbose = False if '-v' in sys.argv: verbose = True sys.argv.remove('-v') + cf = ConfigParser.ConfigParser() + cf.read(['/etc/bcfg2.conf']) + try: + 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) if len(sys.argv) > 1: repo = sys.argv[1] else: - cf.read(['/etc/bcfg2.conf']) try: repo = cf.get('server', 'repository') except (ConfigParser.NoSectionError, ConfigParser.NoOptionError): -- cgit v1.2.3-1-g7c22