From 114d4a82c539c8a78464f0ebba70a5562f8c014c Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Wed, 29 Jun 2005 15:44:42 +0000 Subject: add correct usage stuff (Logical change 1.242) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1010 ce84e21b-d406-0410-9b95-82705330c041 --- tools/ValidateBcfg2Repo | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/ValidateBcfg2Repo b/tools/ValidateBcfg2Repo index d4d980b5c..33833bea2 100644 --- a/tools/ValidateBcfg2Repo +++ b/tools/ValidateBcfg2Repo @@ -3,17 +3,22 @@ from glob import glob from sys import argv, exit from validate import validate, ValidationException +from ConfigParser import ConfigParser, NoOptionError if __name__ == '__main__': + cf = ConfigParser() + cf.read(['/etc/bcfgd.conf']) try: + repo = cf.get('server', 'repository') + except NoOptionError: + if len(argv) == 1: + print "Usage: validate_repo " + raise SystemExit, 1 repo = argv[1] if len(argv) == 3: schemadir = argv[2] else: schemadir = '/usr/share/bcfg2/schemas' - except: - print "Usage: validate_repo " - exit(1) # add more validation as more schemas get written filesets = {'metadata':("%s/etc/metadata.xml", "%s/metadata.xsd"), -- cgit v1.2.3-1-g7c22