diff --git a/src/teuthology_api/routes/kill.py b/src/teuthology_api/routes/kill.py index 7ad7a4a..4e2c364 100644 --- a/src/teuthology_api/routes/kill.py +++ b/src/teuthology_api/routes/kill.py @@ -37,8 +37,8 @@ async def create_run( except HTTPError as http_err: log.error(http_err) raise HTTPException( - status_code=http_err.response.status_code, detail=repr(http_err) + status_code=http_err.response.status_code, detail=str(http_err) ) from http_err except Exception as err: log.error(err) - raise HTTPException(status_code=500, detail=repr(err)) from err + raise HTTPException(status_code=500, detail=str(err)) from err diff --git a/src/teuthology_api/services/helpers.py b/src/teuthology_api/services/helpers.py index 8de5365..29aca5c 100644 --- a/src/teuthology_api/services/helpers.py +++ b/src/teuthology_api/services/helpers.py @@ -63,11 +63,11 @@ def get_run_details(run_name: str): except HTTPError as http_err: log.error(http_err) raise HTTPException( - status_code=http_err.response.status_code, detail=repr(http_err) + status_code=http_err.response.status_code, detail=str(http_err) ) from http_err except Exception as err: log.error(err) - raise HTTPException(status_code=500, detail=repr(err)) from err + raise HTTPException(status_code=500, detail=str(err)) from err def get_username(request: Request): diff --git a/src/teuthology_api/services/kill.py b/src/teuthology_api/services/kill.py index 3c6872d..7034180 100644 --- a/src/teuthology_api/services/kill.py +++ b/src/teuthology_api/services/kill.py @@ -59,12 +59,13 @@ async def run(args, send_logs: bool, token: dict, request: Request): ) stdout, stderr = proc.communicate() returncode = proc.wait(timeout=120) - log.info(stdout) + output_logs = stdout.decode() + log.info(output_logs) if returncode != 0: - raise Exception(stdout) + raise Exception(output_logs) if send_logs: return {"kill": "success", "logs": stdout} return {"kill": "success"} except Exception as exc: log.error("teuthology-kill command failed with the error: %s", repr(exc)) - raise HTTPException(status_code=500, detail=repr(exc)) from exc + raise HTTPException(status_code=500, detail=str(exc)) from exc diff --git a/src/teuthology_api/services/suite.py b/src/teuthology_api/services/suite.py index 99d2d6d..956f344 100644 --- a/src/teuthology_api/services/suite.py +++ b/src/teuthology_api/services/suite.py @@ -43,7 +43,7 @@ def run(args, send_logs: bool, access_token: str): return {"run": run_details} except Exception as exc: log.error("teuthology.suite.main failed with the error: %s", repr(exc)) - raise HTTPException(status_code=500, detail=repr(exc)) from exc + raise HTTPException(status_code=500, detail=str(exc)) from exc def make_run_name(run_dic):