Description
example below:
from libcloud.dns.types import Provider from libcloud.dns.providers import get_driver from libcloud.dns.types import RecordType driver = get_driver(Provider.ROUTE53) dns = driver('REDACTED', 'REDACTED') zone = [zone for zone in dns.list_zones() if zone.domain == 'REDACTED.com.'][0] dns.ex_create_multi_value_record( name='testrecord', zone=zone, type=RecordType.A, data='127.0.0.1\n127.0.0.2\n127.0.0.3\n127.0.0.4', extra={'ttl': 0} ) record = dns.get_record(zone.id,'A:testrecord') record.extra {'_multi_value': True, '_other_records': [{'data': '127.0.0.2', 'extra': {'ttl': 0}, 'name': 'testrecord', 'type': 'A'}, {'data': '127.0.0.3', 'extra': {'ttl': 0}, 'name': 'testrecord', 'type': 'A'}, {'data': '127.0.0.4', 'extra': {'ttl': 0}, 'name': 'testrecord', 'type': 'A'}], 'ttl': 0} record.id 'A:testrecord' dns.delete_record(record) Traceback (most recent call last): File "C:\Python27\lib\site-packages\IPython\core\interactiveshell.py", line 2883, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-29-38c197043e24>", line 1, in <module> dns.delete_record(record) File "C:\Python27\lib\site-packages\libcloud\dns\drivers\route53.py", line 228, in delete_record record_id=r.id) RecordDoesNotExistError: <RecordDoesNotExistError in <libcloud.dns.drivers.route53.Route53DNSDriver object at 0x03140E90>, record_id=A:testrecord, value=> record.delete() Traceback (most recent call last): File "C:\Python27\lib\site-packages\IPython\core\interactiveshell.py", line 2883, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-30-ff7f7979af38>", line 1, in <module> record.delete() File "C:\Python27\lib\site-packages\libcloud\dns\base.py", line 130, in delete return self.driver.delete_record(record=self) File "C:\Python27\lib\site-packages\libcloud\dns\drivers\route53.py", line 228, in delete_record record_id=r.id) RecordDoesNotExistError: <RecordDoesNotExistError in <libcloud.dns.drivers.route53.Route53DNSDriver object at 0x03140E90>, record_id=A:testrecord, value=>
This is the XML that its being generated:
<ChangeResourceRecordSetsRequest xmlns="https://route53.amazonaws.com/doc/2012-02-29/">
<ChangeBatch>
<Changes>
<Change>
<Action>DELETE</Action>
<ResourceRecordSet>
<Name>testrecord.REDACTED.com.</Name>
<Type>A</Type>
<TTL>0</TTL>
<ResourceRecords>
<ResourceRecord>
<Value>127.0.0.1</Value>
</ResourceRecord>
</ResourceRecords>
</ResourceRecordSet>
</Change>
</Changes>
</ChangeBatch>
</ChangeResourceRecordSetsRequest>
So the issue here is that because there is no code to check for multiple value records on delete, it will always fail because the ResourceRecordSet is not properly filled with all the ResourceRecord's for that ResourceRecordSet .
Patch incoming.