From 9763fdb11c8abbcb80ac8ff3ef3f4ff9d6148ff7 Mon Sep 17 00:00:00 2001 From: Adrian Likins Date: Tue, 9 Oct 2007 15:13:24 -0400 Subject: 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 --- func/overlord/func_command.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'func/overlord/func_command.py') 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 -- cgit