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

Added logging for ResourceException error in NS1 requests. #71

Merged
merged 3 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions octodns_ns1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,15 @@ def _try(self, method, *args, **kwargs):
)
sleep(period)
tries -= 1
except ResourceException as e:
self.log.exception(
"_try: method=%s, args=%s, response=%s, body=%s",
method.__name__,
str(args),
e.response,
e.body,
)
raise


class Ns1Provider(BaseProvider):
Expand Down
3 changes: 3 additions & 0 deletions tests/test_provider_ns1.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ def reset():
provider._client.reset_caches()
zone_retrieve_mock.reset_mock()
zone_retrieve_mock.side_effect = None
zone_retrieve_mock.__name__ = 'retrieve'
record_retrieve_mock.reset_mock()
record_retrieve_mock.side_effect = None

Expand Down Expand Up @@ -470,7 +471,9 @@ def reset():
provider._client.reset_caches()
record_retrieve_mock.reset_mock()
zone_create_mock.reset_mock()
zone_create_mock.__name__ = 'create'
zone_retrieve_mock.reset_mock()
zone_retrieve_mock.__name__ = 'retrieve'

# Fails, general error
reset()
Expand Down