summaryrefslogtreecommitdiffstats
path: root/src/sbin/bcfg2-info
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-01-16 13:28:06 -0500
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-01-17 09:25:45 -0500
commitebe7542db7217c2fac3d7111e80f94caedfb69e2 (patch)
tree964db7ae511795d80b3ae50f3e14bc9f3344756a /src/sbin/bcfg2-info
parentae58c24f72a8ed72327fbc3f7305bd69ec6a13db (diff)
downloadbcfg2-ebe7542db7217c2fac3d7111e80f94caedfb69e2.tar.gz
bcfg2-ebe7542db7217c2fac3d7111e80f94caedfb69e2.tar.bz2
bcfg2-ebe7542db7217c2fac3d7111e80f94caedfb69e2.zip
added module-level OptionParser to avoid passing it as an argument or global all over
Diffstat (limited to 'src/sbin/bcfg2-info')
-rwxr-xr-xsrc/sbin/bcfg2-info10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/sbin/bcfg2-info b/src/sbin/bcfg2-info
index fa8c89b46..c697e9fca 100755
--- a/src/sbin/bcfg2-info
+++ b/src/sbin/bcfg2-info
@@ -115,9 +115,9 @@ def load_interpreters():
class InfoCore(cmd.Cmd, Bcfg2.Server.Core.BaseCore):
"""Main class for bcfg2-info."""
- def __init__(self, setup):
+ def __init__(self):
cmd.Cmd.__init__(self)
- Bcfg2.Server.Core.BaseCore.__init__(self, setup=setup)
+ Bcfg2.Server.Core.BaseCore.__init__(self)
self.prompt = '> '
self.cont = True
self.fam.handle_events_in_interval(4)
@@ -751,7 +751,7 @@ def main():
interpreter=Bcfg2.Options.INTERPRETER)
optinfo.update(Bcfg2.Options.CLI_COMMON_OPTIONS)
optinfo.update(Bcfg2.Options.SERVER_COMMON_OPTIONS)
- setup = Bcfg2.Options.OptionParser(optinfo)
+ setup = Bcfg2.Options.get_option_parser(optinfo)
setup.hm = "\n".join([" bcfg2-info [options] [command <command args>]",
"Options:",
setup.buildHelpMessage(),
@@ -772,12 +772,12 @@ def main():
sys.exit(0)
elif setup['profile'] and HAS_PROFILE:
prof = profile.Profile()
- loop = prof.runcall(InfoCore, setup)
+ loop = prof.runcall(InfoCore)
display_trace(prof)
else:
if setup['profile']:
print("Profiling functionality not available.")
- loop = InfoCore(setup)
+ loop = InfoCore()
loop.run(setup['args'])