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

Add SUPPORTS_ROOT_NS to enable mangement of root NS records #19

Merged
merged 4 commits into from
Oct 16, 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v0.0.3 - 2023-??-?? -

* Add SUPPORTS_ROOT_NS to enable mangement of root NS records

## v0.0.2 - 2023-02-15 - Support the filter of weight

* Added filter support with type "weighted_shuffle"
Expand Down
1 change: 1 addition & 0 deletions octodns_edgecenter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def _build_url(base, *items):
class _BaseProvider(BaseProvider):
SUPPORTS_GEO = False
SUPPORTS_DYNAMIC = True
SUPPORTS_ROOT_NS = True
SUPPORTS = set(("A", "AAAA", "NS", "MX", "TXT", "SRV", "CNAME", "PTR"))

def __init__(self, id, api_url, auth_url, *args, **kwargs):
Expand Down
17 changes: 14 additions & 3 deletions tests/test_octodns_provider_edgecenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ def test_apply(self):
plan = provider.plan(self.expected)

# TC: create all
self.assertEqual(13, len(plan.changes))
self.assertEqual(13, provider.apply(plan))
self.assertEqual(14, len(plan.changes))
self.assertEqual(14, provider.apply(plan))
self.assertFalse(plan.exists)

provider._client._request.assert_has_calls(
Expand All @@ -258,6 +258,17 @@ def test_apply(self):
],
},
),
call(
'POST',
'http://api/zones/unit.tests/unit.tests./NS',
data={
'ttl': 300,
'resource_records': [
{'content': ['ns1.edgedns.ru.']},
{'content': ['ns2.edgedns.ru.']},
],
},
),
call(
"POST",
"http://api/zones/unit.tests/_imap._tcp.unit.tests./SRV",
Expand Down Expand Up @@ -383,7 +394,7 @@ def test_apply(self):
]
)
# expected number of total calls
self.assertEqual(16, provider._client._request.call_count)
self.assertEqual(17, provider._client._request.call_count)

# TC: delete 1 and update 1
provider._client._request.reset_mock()
Expand Down