libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Itxaka Serrano (JIRA)" <j...@apache.org>
Subject [jira] [Created] (LIBCLOUD-651) Route53 cant delete a multiple value record
Date Sat, 10 Jan 2015 12:46:34 GMT
Itxaka Serrano created LIBCLOUD-651:
---------------------------------------

             Summary: Route53 cant delete a multiple value record
                 Key: LIBCLOUD-651
                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-651
             Project: Libcloud
          Issue Type: Bug
          Components: DNS
            Reporter: Itxaka Serrano


example below:

{code}
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=>
{code}

This is the XML that its being generated:
{code}
<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>
{code}


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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message