diff --git a/server/kubejob.py b/server/kubejob.py index c085ddc..f43cd20 100644 --- a/server/kubejob.py +++ b/server/kubejob.py @@ -248,10 +248,7 @@ def create_job(command, run_id=None, url=None, commit_ref=None, replicas=1, envi ) ) log.debug(f"Job {job_name}:\n{yaml.dump(job_body, indent=2)}") - # api_response = api_batch_v1.create_namespaced_job( - # namespace=namespace, - # body=job_body - # ) + _ = api_batch_v1.create_namespaced_job(namespace=namespace, body=job_body) response["job_id"] = job_id log.debug(f"Job {job_name} created") # TODO: Is there additional information to obtain from the ApiException? diff --git a/server/server.py b/server/server.py index 922e362..7d8b8c1 100644 --- a/server/server.py +++ b/server/server.py @@ -99,7 +99,7 @@ def getarg(self, arg, default=None): # The datetime type is not JSON serializable, so convert to string def json_converter(self, o): if isinstance(o, datetime): - return o.__str__() + return str(o) def send_response(self, data, http_status_code=global_vars.HTTP_OK, return_json=True, indent=None): if return_json: @@ -128,7 +128,7 @@ def construct_job_object(job_info): destructionTime = None # TODO: Should we track deletion time? try: executionDuration = (endTime - startTime).total_seconds() - except AttributeError: + except Exception: executionDuration = None try: message = job_info["message"]