Skip to content

Commit

Permalink
Merge pull request #10 from opt-nc/bugfix/investigation-timeout-sans-…
Browse files Browse the repository at this point in the history
…raison

Bugfix/investigation timeout sans raison
  • Loading branch information
Dougniel authored Mar 24, 2022
2 parents 54b95f6 + 7dcadbd commit 50fb6fd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions launch_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def launch(self, templateid):
response = requests.post(f"{self.towerurl}/job_templates/{templateid}/launch/",
auth=self.towerauth)

sys.stderr.write(f"status code : {response.status_code}")
sys.stderr.write(f"status code : {response.status_code}\n")
if response.status_code == 201:
return json.loads(response.text).get("job", 0)
sys.stderr.write(f"ERROR :\n{repr(response.text)}\n")
Expand All @@ -54,7 +54,7 @@ def launch_with_vars(self, templateid, extra_vars_file):
response = requests.post(f"{self.towerurl}/job_templates/{templateid}/launch/",
auth=self.towerauth, json={"extra_vars":extra_vars_string} )

sys.stderr.write(f"status code : {response.status_code}")
sys.stderr.write(f"status code : {response.status_code}\n")
if response.status_code == 201:
return json.loads(response.text).get("job", 0)
sys.stderr.write(f"ERROR :\n{repr(response.text)}\n")
Expand All @@ -78,6 +78,7 @@ def wait(self, jobid):
return False
if status in ("failed", "cancelled"):
return True
sys.stderr.write(f"Check {step}/{maxsteps} : {status}\n")
#else :
# pass # ("pending", "waiting", "running")
sys.stderr.write(f"ERROR : Tower Job #{jobid} was still running after {timeout} seconds\n")
Expand Down

0 comments on commit 50fb6fd

Please sign in to comment.