Island: Return empty str, not dict on 404 in AgentLogs.get()

This commit is contained in:
Mike Salvatore 2022-10-02 13:00:45 -04:00
parent c706466cdd
commit 07a6f49e8b
2 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ class AgentLogs(AbstractResource):
log_contents = self._agent_log_repository.get_agent_log(agent_id)
except UnknownRecordError as err:
logger.error(f"Error occurred while getting agent log: {err}")
return {}, HTTPStatus.NOT_FOUND
return "", HTTPStatus.NOT_FOUND
return log_contents, HTTPStatus.OK

View File

@ -26,7 +26,7 @@ def flask_client(build_flask_client):
def test_agent_logs_endpoint__get_empty(flask_client):
resp = flask_client.get(AGENT_LOGS_URL_1, follow_redirects=True)
assert resp.status_code == HTTPStatus.NOT_FOUND
assert resp.json == {}
assert resp.json == ""
@pytest.mark.parametrize(