summaryrefslogtreecommitdiffstats
path: root/func
diff options
context:
space:
mode:
authorKrzysztof A. Adamski <krzysztofa@gmail.com>2008-06-06 18:14:01 -0400
committerKrzysztof A. Adamski <krzysztofa@gmail.com>2008-06-06 18:14:01 -0400
commit2d23caf2f9e96022dd49781bc00c351dcab7c10c (patch)
treea1c6623984398506ce593ba6a8267b0be39acf7c /func
parent3f62e1d302fb63f1f3c5c72121388c8b0dd6e784 (diff)
downloadthird_party-func-2d23caf2f9e96022dd49781bc00c351dcab7c10c.tar.gz
third_party-func-2d23caf2f9e96022dd49781bc00c351dcab7c10c.tar.xz
third_party-func-2d23caf2f9e96022dd49781bc00c351dcab7c10c.zip
Jobthing status codes cleanup.
Diffstat (limited to 'func')
-rw-r--r--func/jobthing.py13
-rw-r--r--func/overlord/cmd_modules/call.py4
2 files changed, 8 insertions, 9 deletions
diff --git a/func/jobthing.py b/func/jobthing.py
index 75a1d1a..bbc4f89 100644
--- a/func/jobthing.py
+++ b/func/jobthing.py
@@ -27,8 +27,7 @@ import utils
JOB_ID_RUNNING = 0
JOB_ID_FINISHED = 1
JOB_ID_LOST_IN_SPACE = 2
-JOB_ID_ASYNC_PARTIAL = 3
-JOB_ID_ASYNC_FINISHED = 4
+JOB_ID_PARTIAL = 3
# how long to retain old job records in the job id database
RETAIN_INTERVAL = 60 * 60
@@ -121,7 +120,7 @@ def batch_run(server, process_server, nforks):
results = forkbomb.batch_run(server, process_server, nforks)
# we now have a list of job id's for each minion, kill the task
- __update_status(job_id, JOB_ID_ASYNC_PARTIAL, results)
+ __update_status(job_id, JOB_ID_PARTIAL, results)
sys.exit(0)
def minion_async_run(retriever, method, args):
@@ -158,13 +157,13 @@ def job_status(jobid, client_class=None):
got_status = __get_status(jobid)
- # if the status comes back as JOB_ID_ASYNC_PARTIAL what we have is actually a hash
+ # if the status comes back as JOB_ID_PARTIAL what we have is actually a hash
# of hostname/minion-jobid pairs. Instantiate a client handle for each and poll them
# for their actual status, filling in only the ones that are actually done.
(interim_rc, interim_results) = got_status
- if interim_rc == JOB_ID_ASYNC_PARTIAL:
+ if interim_rc == JOB_ID_PARTIAL:
partial_results = {}
@@ -187,9 +186,9 @@ def job_status(jobid, client_class=None):
some_missing = True
if some_missing:
- return (JOB_ID_ASYNC_PARTIAL, partial_results)
+ return (JOB_ID_PARTIAL, partial_results)
else:
- return (JOB_ID_ASYNC_FINISHED, partial_results)
+ return (JOB_ID_FINISHED, partial_results)
else:
return got_status
diff --git a/func/overlord/cmd_modules/call.py b/func/overlord/cmd_modules/call.py
index edf9f38..bb9a61e 100644
--- a/func/overlord/cmd_modules/call.py
+++ b/func/overlord/cmd_modules/call.py
@@ -146,11 +146,11 @@ class Call(base_command.BaseCommand):
(return_code, async_results) = self.overlord_obj.job_status(results)
if return_code == jobthing.JOB_ID_RUNNING:
time.sleep(0.1)
- elif return_code == jobthing.JOB_ID_ASYNC_FINISHED:
+ elif return_code == jobthing.JOB_ID_FINISHED:
async_done = True
partial = self.print_partial_results(partial, async_results, self.options.sort)
return partial
- elif return_code == jobthing.JOB_ID_ASYNC_PARTIAL:
+ elif return_code == jobthing.JOB_ID_PARTIAL:
if not self.options.sort:
partial = self.print_partial_results(partial, async_results)
else: