Browse Source

Merge remote-tracking branch 'origin/master' into python3-start

pull/384/head
Ross McFarland 6 years ago
parent
commit
c788681e7c
No known key found for this signature in database GPG Key ID: 61C10C4FC8FE4A89
2 changed files with 16 additions and 3 deletions
  1. +4
    -0
      octodns/provider/constellix.py
  2. +12
    -3
      tests/test_octodns_provider_constellix.py

+ 4
- 0
octodns/provider/constellix.py View File

@ -149,6 +149,10 @@ class ConstellixClient(object):
self._request('POST', path, data=params)
def record_delete(self, zone_name, record_type, record_id):
# change ALIAS records to ANAME
if record_type == 'ALIAS':
record_type = 'ANAME'
zone_id = self.domains.get(zone_name, False)
path = '/{}/records/{}/{}'.format(zone_id, record_type, record_id)
self._request('DELETE', path)


+ 12
- 3
tests/test_octodns_provider_constellix.py View File

@ -193,6 +193,14 @@ class TestConstellixProvider(TestCase):
'value': [
'3.2.3.4'
]
}, {
'id': 11189899,
'type': 'ALIAS',
'name': 'alias',
'ttl': 600,
'value': [{
'value': 'aname.unit.tests.'
}]
}
])
@ -207,8 +215,8 @@ class TestConstellixProvider(TestCase):
}))
plan = provider.plan(wanted)
self.assertEquals(2, len(plan.changes))
self.assertEquals(2, provider.apply(plan))
self.assertEquals(3, len(plan.changes))
self.assertEquals(3, provider.apply(plan))
# recreate for update, and deletes for the 2 parts of the other
provider._client._request.assert_has_calls([
@ -220,5 +228,6 @@ class TestConstellixProvider(TestCase):
'ttl': 300
}),
call('DELETE', '/123123/records/A/11189897'),
call('DELETE', '/123123/records/A/11189898')
call('DELETE', '/123123/records/A/11189898'),
call('DELETE', '/123123/records/ANAME/11189899')
], any_order=True)

Loading…
Cancel
Save