diff options
author | Adrian Likins <alikins@grimlock.devel.redhat.com> | 2007-10-09 15:13:24 -0400 |
---|---|---|
committer | Adrian Likins <alikins@grimlock.devel.redhat.com> | 2007-10-09 15:13:24 -0400 |
commit | 9763fdb11c8abbcb80ac8ff3ef3f4ff9d6148ff7 (patch) | |
tree | e7d376aafa26150da2c103e03f5b315833dc17ba /func/overlord/cmd_modules/show.py | |
parent | 45c032a1db94a709ec66995d3e9841630f46e3aa (diff) | |
download | third_party-func-9763fdb11c8abbcb80ac8ff3ef3f4ff9d6148ff7.tar.gz third_party-func-9763fdb11c8abbcb80ac8ff3ef3f4ff9d6148ff7.tar.xz third_party-func-9763fdb11c8abbcb80ac8ff3ef3f4ff9d6148ff7.zip |
make func_command use the new handleArguments method from
command.Command. Use this to fetch the hostnamegoo
client.py: pull out expand_servers to module scope,
and isServer(). This method basically tries to see
if what we think is hostnamegoo is actually hostnamegoo.
Kind of a guess atm.
cmd_modules/call.py: change this so it doesn't do it's
own parsing out of the hostname goo, instead using that
from func_command (aka, the top level command parser)
cmd_modules/show.py: just a cmd line module in early
development
Diffstat (limited to 'func/overlord/cmd_modules/show.py')
-rw-r--r-- | func/overlord/cmd_modules/show.py | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/func/overlord/cmd_modules/show.py b/func/overlord/cmd_modules/show.py new file mode 100644 index 0000000..10f44b3 --- /dev/null +++ b/func/overlord/cmd_modules/show.py @@ -0,0 +1,71 @@ +#!/usr/bin/python + +import optparse +import pprint +import xmlrpclib + +from func.overlord import command +from func.overlord import client + +DEFAULT_PORT = 51234 + + +class ShowHardware(client.command.Command): + name = "hardware" + useage = "show hardware details" + + # FIXME: we might as well make verbose be in the subclass + # and probably an inc variable while we are at it + def addOptions(self): + self.parser.add_option("-v", "--verbose", dest="verbose", + action="store_true") + self.parser.add_option("-p", "--port", dest="port", + default=DEFAULT_PORT) + + + def parse(self, argv): + self.argc = argv + return command.Command.parse(self.argv) + + def do(self,args): + client_obj = client.Client(self.server_spec,port=self.port,interactive=True, + verbose=self.verbose, config=self.config) + + + +class Show(client.command.Command): + name = "show" + useage = "various simple report stuff" + subCommands = [ShowHardware] + def addOptions(self): + self.parser.add_option("-v", "--verbose", dest="verbose", + action="store_true") + self.parser.add_option("-p", "--port", dest="port", + default=DEFAULT_PORT) + + def handleOptions(self, options): + self.options = options + + self.verbose = options.verbose + self.port = options.port + + + def parse(self, argv): + self.argv = argv + + return command.Command.parse(self, argv) + + + def do(self, args): + print "do args", args + return "bar" +# client_obj = client.Client(self.server_spec,port=self.port,interactive=True, +# verbose=self.verbose, config=self.config) +# results = client_obj.run(self.module, self.method, self.method_args) + + # TO DO: add multiplexer support + # probably as a higher level module. + + # dump the return code stuff atm till we figure out the right place for it +# return self.format_return(results) + |