1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

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

This commit is contained in:
Ross McFarland
2019-10-14 07:25:07 -07:00
2 changed files with 16 additions and 3 deletions

View File

@@ -149,6 +149,10 @@ class ConstellixClient(object):
self._request('POST', path, data=params) self._request('POST', path, data=params)
def record_delete(self, zone_name, record_type, record_id): 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) zone_id = self.domains.get(zone_name, False)
path = '/{}/records/{}/{}'.format(zone_id, record_type, record_id) path = '/{}/records/{}/{}'.format(zone_id, record_type, record_id)
self._request('DELETE', path) self._request('DELETE', path)

View File

@@ -193,6 +193,14 @@ class TestConstellixProvider(TestCase):
'value': [ 'value': [
'3.2.3.4' '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) plan = provider.plan(wanted)
self.assertEquals(2, len(plan.changes)) self.assertEquals(3, len(plan.changes))
self.assertEquals(2, provider.apply(plan)) self.assertEquals(3, provider.apply(plan))
# recreate for update, and deletes for the 2 parts of the other # recreate for update, and deletes for the 2 parts of the other
provider._client._request.assert_has_calls([ provider._client._request.assert_has_calls([
@@ -220,5 +228,6 @@ class TestConstellixProvider(TestCase):
'ttl': 300 'ttl': 300
}), }),
call('DELETE', '/123123/records/A/11189897'), 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) ], any_order=True)