summaryrefslogtreecommitdiffstats
path: root/func
diff options
context:
space:
mode:
authorKrzysztof A. Adamski <krzysztofa@gmail.com>2008-05-31 07:44:07 -0400
committerKrzysztof A. Adamski <krzysztofa@gmail.com>2008-05-31 07:44:07 -0400
commitcbb7650e359f8870cd59501bc0e9904d5a9e6ea6 (patch)
tree78d7602ade0e35c9d0067fa723732cbacc2b299f /func
parent9de932b2608445f100565f4ee37d383d8dd72ff9 (diff)
downloadthird_party-func-cbb7650e359f8870cd59501bc0e9904d5a9e6ea6.tar.gz
third_party-func-cbb7650e359f8870cd59501bc0e9904d5a9e6ea6.tar.xz
third_party-func-cbb7650e359f8870cd59501bc0e9904d5a9e6ea6.zip
Added --jobthing option to 'call' cmd_module.
Diffstat (limited to 'func')
-rw-r--r--func/overlord/cmd_modules/call.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/func/overlord/cmd_modules/call.py b/func/overlord/cmd_modules/call.py
index bc21b51..fcae0b3 100644
--- a/func/overlord/cmd_modules/call.py
+++ b/func/overlord/cmd_modules/call.py
@@ -52,9 +52,12 @@ class Call(base_command.BaseCommand):
self.parser.add_option("-n", "--nopoll", dest="nopoll",
help="Don't wait for async results",
action="store_true")
- self.parser.add_option("-s", "--sort", dest="sort",
+ self.parser.add_option("", "--sort", dest="sort",
help="In async mode, wait for all results and print them sorted.",
action="store_true")
+ self.parser.add_option("-s", "--jobstatus", dest="jobstatus",
+ help="Do not run any job, just check for status.",
+ action="store_true")
def handleOptions(self, options):
self.options = options
@@ -124,12 +127,19 @@ class Call(base_command.BaseCommand):
self.getOverlord()
- results = self.overlord_obj.run(self.module, self.method, self.method_args)
+ if not self.options.jobstatus:
+ results = self.overlord_obj.run(self.module, self.method, self.method_args)
+ else:
+ (return_code, async_results) = self.overlord_obj.job_status(float(self.module))
+ res = self.format_return((return_code, async_results))
+ print res
+ return 0
if self.options.async:
partial = {}
if self.options.nopoll:
- print "JOB_ID", results
+ print "JOB_ID:", pprint.pformat(results)
+ return 0
else:
async_done = False
while not async_done: