summaryrefslogtreecommitdiffstats
path: root/src/sbin/bcfg2-repo-validate
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2006-07-14 22:38:02 +0000
committerNarayan Desai <desai@mcs.anl.gov>2006-07-14 22:38:02 +0000
commitaf03b573c55a8239c26236769bb5fd4e2a01a0f6 (patch)
tree66edb6d24e2fd61f5447cb654f8793f9d7a9173f /src/sbin/bcfg2-repo-validate
parent554fe943e48eb94dd6179a033f4284385a9b749d (diff)
downloadbcfg2-af03b573c55a8239c26236769bb5fd4e2a01a0f6.tar.gz
bcfg2-af03b573c55a8239c26236769bb5fd4e2a01a0f6.tar.bz2
bcfg2-af03b573c55a8239c26236769bb5fd4e2a01a0f6.zip
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
Diffstat (limited to 'src/sbin/bcfg2-repo-validate')
-rw-r--r--src/sbin/bcfg2-repo-validate12
1 files changed, 9 insertions, 3 deletions
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):