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/func_command.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/func_command.py')
-rw-r--r-- | func/overlord/func_command.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/func/overlord/func_command.py b/func/overlord/func_command.py index dceec18..2210334 100644 --- a/func/overlord/func_command.py +++ b/func/overlord/func_command.py @@ -5,13 +5,18 @@ import sys import command + +#FIXME: need a plug-in runtime module loader here from cmd_modules import call +from cmd_modules import show + +from func.overlord import client class FuncCommandLine(command.Command): name = "client" useage = "func is the commandline interface to a func minion" - subCommandClasses = [call.Call] + subCommandClasses = [call.Call,show.Show] def __init__(self): @@ -26,6 +31,17 @@ class FuncCommandLine(command.Command): self.parser.add_option("--list-minions", dest="list_minions", action="store_true", help="list all available minions") + def handleArguments(self, args): + server_string = args[0] + # try to be clever about this for now + if client.isServer(server_string): + self.server_spec = server_string + args.pop(0) + # if it doesn't look like server, assume it + # is a sub command? that seems wrong, what about + # typo's and such? How to catch that? -akl + # maybe a class variable self.data on Command? + def handleOptions(self, options): if options.version: #FIXME |