From 9d733a88ef517bc18b421e7c13402fddb70b452d Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Tue, 8 Jan 2008 03:42:23 +0000 Subject: finish up options changeover git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4199 ce84e21b-d406-0410-9b95-82705330c041 --- src/sbin/bcfg2-remote | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'src/sbin/bcfg2-remote') diff --git a/src/sbin/bcfg2-remote b/src/sbin/bcfg2-remote index 5f6c3990b..c33fcfbfe 100755 --- a/src/sbin/bcfg2-remote +++ b/src/sbin/bcfg2-remote @@ -8,27 +8,21 @@ import Bcfg2.Options, Bcfg2.Logging, logging, socket, sys if __name__ == '__main__': opts = { - 'agent-port': (('-p', '', 'agent TCP port'), - False, ('communication', 'agent-port'), - '6789', False), - 'host': (('-H', '', 'agent host'), - False, False, False, False), - 'setup': (('-C', '', "config file path"), - False, False, '/etc/bcfg2.conf', False), - 'key': (('-k', '', 'ssl key path'), - False, ('communication', 'key'), False, False), - 'debug': (('-d', '', 'debug level (0-40)'), - False, False, 0, False), + 'agent-port': Bcfg2.Options.AGENT_PORT, + 'host': Bcfg2.Options.AGENT_HOST, + 'setup': Bcfg2.Options.CFILE, + 'key': Bcfg2.Options.SERVER_KEY, + 'debug': Bcfg2.Options.DEBUG, } - optparser = Bcfg2.Options.OptionParser('bcfg2', opts) - setup = optparser.parse() + setup = Bcfg2.Options.OptionParser(opts) + setup.parse(sys.argv[1:]) Bcfg2.Logging.setup_logging('bcfg2-remote', to_syslog=False, level=int(setup['debug'])) logger = logging.getLogger('bcfg2-remote') if not setup['host']: logger.error("-H option is required") - logger.error(optparser.helpmsg) + logger.error(setup.buildHelpMessage()) raise SystemExit(1) s = open(setup['key']).read() x509 = X509() -- cgit v1.2.3-1-g7c22