summaryrefslogtreecommitdiffstats
path: root/src/sbin
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2008-01-08 03:42:23 +0000
committerNarayan Desai <desai@mcs.anl.gov>2008-01-08 03:42:23 +0000
commit9d733a88ef517bc18b421e7c13402fddb70b452d (patch)
treec7bda1dc704319f5f94598f5a5038f362af606d0 /src/sbin
parent67d50c4f86d3aa0612f179de59061ff3d32aa86e (diff)
downloadbcfg2-9d733a88ef517bc18b421e7c13402fddb70b452d.tar.gz
bcfg2-9d733a88ef517bc18b421e7c13402fddb70b452d.tar.bz2
bcfg2-9d733a88ef517bc18b421e7c13402fddb70b452d.zip
finish up options changeover
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4199 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/sbin')
-rwxr-xr-xsrc/sbin/bcfg2-remote22
1 files changed, 8 insertions, 14 deletions
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>', 'agent TCP port'),
- False, ('communication', 'agent-port'),
- '6789', False),
- 'host': (('-H', '<agent host>', 'agent host'),
- False, False, False, False),
- 'setup': (('-C', '<configfile>', "config file path"),
- False, False, '/etc/bcfg2.conf', False),
- 'key': (('-k', '<ssl key>', 'ssl key path'),
- False, ('communication', 'key'), False, False),
- 'debug': (('-d', '<debug level>', '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()