Skip to content

Commit

Permalink
Fixing IIB KeyError when updating request state
Browse files Browse the repository at this point in the history
[CLOUDDST-20361]
  • Loading branch information
lipoja committed Sep 26, 2023
1 parent d5b6911 commit 1362a34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion iib/workers/api_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def update_request(
rv.text,
)
if exc_msg:
_exc_msg = exc_msg.format(**payload)
_exc_msg = exc_msg.format(**payload, request_id=request_id)
else:
_exc_msg = f'The worker failed to update the request {request_id}'
raise IIBError(_exc_msg)
Expand Down
5 changes: 4 additions & 1 deletion tests/test_workers/test_api_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ def test_update_request_connection_failed(mock_session):
'exc_msg, expected',
(
(None, 'The worker failed to update the request 3'),
('Failed to set index_image={index_image}', 'Failed to set index_image=index-image:latest'),
(
'Failed to set index_image={index_image} on request {request_id}',
'Failed to set index_image=index-image:latest on request 3',
),
),
)
@mock.patch('iib.workers.api_utils.requests_auth_session')
Expand Down

0 comments on commit 1362a34

Please sign in to comment.