Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

We are now printing output of the job on the console

Added output method to job class
  • Loading branch information...
commit 714b39ecbf46d908331418db13aeca2258a0f30c 1 parent 1d572e3
Nikhil Singh authored
Showing with 11 additions and 3 deletions.
  1. +8 −1 job.py
  2. +2 −1  roadrunner.py
  3. +1 −1  worker.py
View
9 job.py
@@ -134,7 +134,7 @@ def poll(self):
else:
self._rcs[unique] = 3
- self._output[unique] = output["output"]
+ self._output[unique] = (output["host"], output["output"])
def success(self):
@@ -154,3 +154,10 @@ def success(self):
return True
else:
return False
+
+
+ def output(self):
+ # Pretty print the output
+ print "Job id: " + self._job_id
+ for gmjobid, output in self._output.items():
+ print "Output for host: " + output[0] + "\n" + output[1]
View
3  roadrunner.py
@@ -61,8 +61,10 @@ def subprocess_wrapper(j):
j.poll()
if j.success():
l.debug("Job: " + j._job_id + " executed successfully!")
+ j.output()
else:
l.error("Job: " + j._job_id + " failed!")
+ j.output()
sys.exit(1)
@@ -71,7 +73,6 @@ def subprocess_wrapper(j):
#
def run_jobs(job_flow_config):
# Mandatory fields required in a job flow config
- output_plugin = get_dict_val('output_plugin', job_flow_config, True)
flow = get_dict_val('job_flow', job_flow_config, True)
default_timeout = get_dict_val('default_job_timeout', job_flow_config, True)
default_retries = get_dict_val('default_retries', job_flow_config, True)
View
2  worker.py
@@ -37,7 +37,7 @@ def exe_job(worker, job):
retries = retries - 1
- return json.dumps({ "rc": rc, "output": output })
+ return json.dumps({ "rc": rc, "output": output, "host": d['host'] })
#
Please sign in to comment.
Something went wrong with that request. Please try again.