Skip to content

Commit

Permalink
Merge pull request #842 from THS-on/fix-verifier-finish
Browse files Browse the repository at this point in the history
verifier: do not call finish() twice
  • Loading branch information
maugustosilva committed Jan 20, 2022
2 parents f3fb006 + d68340a commit a82aad4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions keylime/cloud_verifier_tornado.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ def post(self):
VerfierMain).filter_by(agent_id=agent_id).count()
except SQLAlchemyError as e:
logger.error('SQLAlchemy Error: %s', e)
raise e

# don't allow overwriting

Expand All @@ -446,6 +447,7 @@ def post(self):
session.commit()
except SQLAlchemyError as e:
logger.error('SQLAlchemy Error: %s', e)
raise e

for key in list(exclude_db.keys()):
agent_data[key] = exclude_db[key]
Expand All @@ -461,8 +463,6 @@ def post(self):
logger.warning("POST returning 400 response. Exception error: %s", e)
logger.exception(e)

self.finish()

def put(self):
"""This method handles the PUT requests to add agents to the Cloud Verifier.
Expand Down Expand Up @@ -497,6 +497,7 @@ def put(self):
agent_id=agent_id, verifier_id=verifier_id).one()
except SQLAlchemyError as e:
logger.error('SQLAlchemy Error: %s', e)
raise e

if agent is None:
web_util.echo_json_response(self, 404, "agent id not found")
Expand Down Expand Up @@ -529,7 +530,6 @@ def put(self):
web_util.echo_json_response(self, 400, "Exception error: %s" % e)
logger.warning("PUT returning 400 response. Exception error: %s", e)
logger.exception(e)
self.finish()

def data_received(self, chunk):
raise NotImplementedError()
Expand Down

0 comments on commit a82aad4

Please sign in to comment.