Skip to content

Commit

Permalink
Fixes from handling linter issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
mareuter committed May 4, 2024
1 parent 44c9126 commit 10aa5b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions server/kubejob.py
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"]
Expand Down

0 comments on commit 10aa5b2

Please sign in to comment.