From 27f76c58e706233664a70504c220da3a55c0e06a Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Tue, 8 Jan 2008 05:07:17 +0000 Subject: Switch all parsing to outer scripts for Component git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4206 ce84e21b-d406-0410-9b95-82705330c041 --- src/sbin/bcfg2-server | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/sbin/bcfg2-server') diff --git a/src/sbin/bcfg2-server b/src/sbin/bcfg2-server index 8d8c65170..cb27e9c89 100755 --- a/src/sbin/bcfg2-server +++ b/src/sbin/bcfg2-server @@ -33,7 +33,9 @@ class Bcfg2Serv(Bcfg2.Component.Component): def __init__(self, setup): try: - Bcfg2.Component.Component.__init__(self, setup) + Bcfg2.Component.Component.__init__(self, setup['key'], + setup['password'], + setup['location']) except Bcfg2.Component.ComponentInitError: raise SetupError @@ -190,6 +192,12 @@ if __name__ == '__main__': 'structures': Bcfg2.Options.SERVER_STRUCTURES, 'generators': Bcfg2.Options.SERVER_GENERATORS, 'password': Bcfg2.Options.SERVER_PASSWORD}) + OPTINFO.update({'key' : Bcfg2.Options.SERVER_KEY, + 'location' : Bcfg2.Options.SERVER_LOCATION, + 'passwd' : Bcfg2.Options.SERVER_PASSWORD, + 'static' : Bcfg2.Options.SERVER_STATIC, + }) + setup = Bcfg2.Options.OptionParser(OPTINFO) setup.parse(sys.argv[1:]) @@ -203,6 +211,9 @@ if __name__ == '__main__': else: Bcfg2.Logging.setup_logging('bcfg2-server', level=level) + if not setup['key']: + print "No key specified in '%s'" % setup['configfile'] + raise SystemExit, 1 try: BSERV = Bcfg2Serv(setup) -- cgit v1.2.3-1-g7c22