Skip to content

Commit

Permalink
Removed duplication of logging which request is executed
Browse files Browse the repository at this point in the history
  • Loading branch information
bartvanb committed Nov 16, 2022
1 parent f1f46ca commit bc3cb9a
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions vantage6-server/vantage6/server/resource/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,23 +104,20 @@ def decorator(*args, **kwargs):
g.user = user
assert g.user.type == g.type
log.debug(
f"Received request {request.method} {request.url_rule} "
f"from user {user.username} ({user.id})")
f"Received request from user {user.username} ({user.id})")

elif g.type == 'node':
node = get_and_update_authenticatable_info(identity)
g.node = node
assert g.node.type == g.type
log.debug(
f"Received request {request.method} {request.url_rule} "
f"from node {node.name} ({node.id})")
f"Received request from node {node.name} ({node.id})")

elif g.type == 'container':
g.container = identity
log.debug(
f"Received request {request.method} {request.url_rule} "
f"from container from node id {identity['node_id']} and "
f"task id {identity['task_id']}")
"Received request from container with node id "
f"{identity['node_id']} and task id {identity['task_id']}")

else:
raise Exception(f"Unknown entity: {g.type}")
Expand Down

0 comments on commit bc3cb9a

Please sign in to comment.