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

Bump required octodns >= 1.5, address pending deprecations #44

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## v1.0.0 - 2024-??-?? - ???

Noteworthy Changes:

* Complete removal of SPF record support, records should be transitioned to TXT
values before updating to this version.

Changes:

* Address pending octoDNS 2.x deprecations, require minimum of 1.5.x

## v0.0.3 - 2024-02-19 - TLSA record support

- Add support for TLSA records
Expand Down
3 changes: 0 additions & 3 deletions octodns_gandi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ class GandiProvider(BaseProvider):
'MX',
'NS',
'PTR',
'SPF',
'SRV',
'SSHFP',
'TLSA',
Expand Down Expand Up @@ -162,7 +161,6 @@ def _data_for_multiple(self, _type, records):
_data_for_A = _data_for_multiple
_data_for_AAAA = _data_for_multiple
_data_for_TXT = _data_for_multiple
_data_for_SPF = _data_for_multiple
_data_for_NS = _data_for_multiple

def _data_for_CAA(self, _type, records):
Expand Down Expand Up @@ -315,7 +313,6 @@ def _params_for_multiple(self, record):
_params_for_AAAA = _params_for_multiple
_params_for_NS = _params_for_multiple
_params_for_TXT = _params_for_multiple
_params_for_SPF = _params_for_multiple

def _params_for_CAA(self, record):
return {
Expand Down
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,5 @@ sections="FUTURE,STDLIB,THIRDPARTY,OCTODNS,FIRSTPARTY,LOCALFOLDER"
[tool.pytest.ini_options]
filterwarnings = [
'error',
# TODO: remove once octodns 2.0 has been released
'ignore:.*DEPRECATED.*2.0',
]
pythonpath = "."
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def version():
),
'test': tests_require,
},
install_requires=('octodns>=0.9.17', 'requests>=2.27.0'),
install_requires=('octodns>=1.5.0', 'requests>=2.27.0'),
license='MIT',
long_description=long_description,
long_description_content_type='text/markdown',
Expand Down
19 changes: 1 addition & 18 deletions tests/config/unit.tests.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
---
? ''
: - geo:
AF:
- 2.2.3.4
- 2.2.3.5
AS-JP:
- 3.2.3.4
- 3.2.3.5
NA-US:
- 4.2.3.4
- 4.2.3.5
NA-US-CA:
- 5.2.3.4
- 5.2.3.5
ttl: 300
: - ttl: 300
type: A
values:
- 1.2.3.4
Expand Down Expand Up @@ -163,10 +150,6 @@ ptr:
ttl: 300
type: PTR
values: [foo.bar.com.]
spf:
ttl: 600
type: SPF
value: v=spf1 ip4:192.168.0.1/16-all
sub:
type: 'NS'
values:
Expand Down
18 changes: 4 additions & 14 deletions tests/test_octodns_provider_gandi.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class TestGandiProvider(TestCase):

# We remove this record from the test zone as Gandi API reject it
# (rightfully).
expected._remove_record(
expected.remove_record(
Record.new(
expected,
'sub',
Expand Down Expand Up @@ -132,7 +132,7 @@ def test_populate(self):

zone = Zone('unit.tests.', [])
provider.populate(zone)
self.assertEqual(18, len(zone.records))
self.assertEqual(17, len(zone.records))
changes = self.expected.changes(zone, provider)
self.assertEqual(0, len(changes))

Expand All @@ -150,7 +150,7 @@ def test_populate(self):
provider.populate(zone)
self.assertEqual(13, len(zone.records))
changes = self.expected.changes(zone, provider)
self.assertEqual(26, len(changes))
self.assertEqual(25, len(changes))

# 2nd populate makes no network calls/all from cache
again = Zone('unit.tests.', [])
Expand Down Expand Up @@ -392,16 +392,6 @@ def test_apply(self):
'rrset_values': ['foo.bar.com.'],
},
),
call(
'POST',
'/livedns/domains/unit.tests/records',
data={
'rrset_name': 'spf',
'rrset_ttl': 600,
'rrset_type': 'SPF',
'rrset_values': ['v=spf1 ip4:192.168.0.1/16-all'],
},
),
call(
'POST',
'/livedns/domains/unit.tests/records',
Expand Down Expand Up @@ -440,7 +430,7 @@ def test_apply(self):
]
)
# expected number of total calls
self.assertEqual(21, provider._client._request.call_count)
self.assertEqual(20, provider._client._request.call_count)

provider._client._request.reset_mock()

Expand Down
Loading