diff options
Diffstat (limited to 'func/overlord/cmd_modules/call.py')
-rw-r--r-- | func/overlord/cmd_modules/call.py | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/func/overlord/cmd_modules/call.py b/func/overlord/cmd_modules/call.py index ea16975..dda57eb 100644 --- a/func/overlord/cmd_modules/call.py +++ b/func/overlord/cmd_modules/call.py @@ -20,10 +20,9 @@ import xmlrpclib from func.overlord import command from func.overlord import client -DEFAULT_PORT = 51234 DEFAULT_FORKS = 1 -class Call(client.command.Command): +class Call(client.command.BaseCommand): name = "call" usage = "call module method name arg1 arg2..." def addOptions(self): @@ -38,17 +37,13 @@ class Call(client.command.Command): self.parser.add_option("-j", "--json", dest="json", help="output return data using JSON", action="store_true") - self.parser.add_option("-p", "--port", dest="port", - default=DEFAULT_PORT) self.parser.add_option("-f", "--forks", dest="forks", help="how many parallel processes? (default 1)", default=DEFAULT_FORKS) def handleOptions(self, options): self.options = options - self.verbose = options.verbose - self.port = options.port # I'm not really a fan of the "module methodname" approach # but we'll keep it for now -akl @@ -56,7 +51,7 @@ class Call(client.command.Command): def parse(self, argv): self.argv = argv - return command.Command.parse(self, argv) + return command.BaseCommand.parse(self, argv) def format_return(self, data): @@ -101,15 +96,16 @@ class Call(client.command.Command): # this with multiple.parentCommand.parentCommands... # maybe command.py needs a way to set attrs on subCommands? # or some sort of shared datastruct? - self.server_spec = self.parentCommand.server_spec + # self.getOverlord() + - overlord_obj = client.Overlord(self.server_spec,port=self.port, - interactive=True, - verbose=self.verbose, - config=self.config, - nforks=self.options.forks) - results = overlord_obj.run(self.module, self.method, self.method_args) + self.interactive = True + + self.server_spec = self.parentCommand.server_spec + self.getOverlord() + + results = self.overlord_obj.run(self.module, self.method, self.method_args) # TO DO: add multiplexer support # probably as a higher level module. |