From ebe7542db7217c2fac3d7111e80f94caedfb69e2 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Wed, 16 Jan 2013 13:28:06 -0500 Subject: added module-level OptionParser to avoid passing it as an argument or global all over --- src/sbin/bcfg2-server | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/sbin/bcfg2-server') diff --git a/src/sbin/bcfg2-server b/src/sbin/bcfg2-server index 8322edeaa..7e7dede30 100755 --- a/src/sbin/bcfg2-server +++ b/src/sbin/bcfg2-server @@ -16,13 +16,13 @@ def main(): optinfo.update(Bcfg2.Options.CLI_COMMON_OPTIONS) optinfo.update(Bcfg2.Options.SERVER_COMMON_OPTIONS) optinfo.update(Bcfg2.Options.DAEMON_COMMON_OPTIONS) - setup = Bcfg2.Options.OptionParser(optinfo) + setup = Bcfg2.Options.get_option_parser(args=optinfo) setup.parse(sys.argv[1:]) # check whether the specified bcfg2.conf exists if not os.path.exists(setup['configfile']): print("Could not read %s" % setup['configfile']) sys.exit(1) - + if setup['backend'] not in ['best', 'cherrypy', 'builtin']: print("Unknown server backend %s, using 'best'" % setup['backend']) setup['backend'] = 'best' @@ -37,7 +37,7 @@ def main(): from Bcfg2.Server.BuiltinCore import Core try: - core = Core(setup) + core = Core() core.run() except CoreInitError: msg = sys.exc_info()[1] -- cgit v1.2.3-1-g7c22 From 41cfeba3ec2f4287dc1294a2c421e64f7b1224f8 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Thu, 17 Jan 2013 10:00:20 -0500 Subject: Options: split loading a new OptionParser from fetching an existing parser --- src/sbin/bcfg2-server | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/sbin/bcfg2-server') diff --git a/src/sbin/bcfg2-server b/src/sbin/bcfg2-server index 7e7dede30..8e96d65f2 100755 --- a/src/sbin/bcfg2-server +++ b/src/sbin/bcfg2-server @@ -16,7 +16,7 @@ def main(): optinfo.update(Bcfg2.Options.CLI_COMMON_OPTIONS) optinfo.update(Bcfg2.Options.SERVER_COMMON_OPTIONS) optinfo.update(Bcfg2.Options.DAEMON_COMMON_OPTIONS) - setup = Bcfg2.Options.get_option_parser(args=optinfo) + setup = Bcfg2.Options.load_option_parser(optinfo) setup.parse(sys.argv[1:]) # check whether the specified bcfg2.conf exists if not os.path.exists(setup['configfile']): -- cgit v1.2.3-1-g7c22