Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix licensing client error logging #329

Merged
merged 2 commits into from
Jul 17, 2024

Conversation

Cristi1324
Copy link
Contributor

This PR fixes error log in licensing client when deleting reservation.

Copy link
Contributor

@Dany9966 Dany9966 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly LGTM, apart from some NITs and a test case addition request


mock_response.raise_for_status.assert_called_once()

mock_response = self.setup_mock_response(mock_post)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't this supposed to setup the Exception side_effect?

{'error': {'code': 409, 'message': 'test_message'}}
)
mock_raise_response_error.assert_called_once_with(mock_response)
mock_response.raise_for_status.assert_not_called()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any raise_for_status call in _do_req we should be concerned about?

@@ -405,4 +477,4 @@ def test_delete_reservation(self, mock_do_req):
'delete', '/reservations/%s' % self.reservation_id,
raw_response=True
)
mock_response.raise_for_status.assert_called_once()
mock_raise_response_error.assert_called_once_with(mock_response)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add a case for delete_reservation where the response if not ok, and the error code is different from 404.

@Cristi1324 Cristi1324 force-pushed the fix_licensing_error_log branch 3 times, most recently from c470666 to a062898 Compare July 17, 2024 12:58
@Cristi1324 Cristi1324 force-pushed the fix_licensing_error_log branch from a062898 to 6160f71 Compare July 17, 2024 13:06
@Dany9966 Dany9966 merged commit 2c130ba into cloudbase:master Jul 17, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants