Fix route53 hosted zone id parsing.
The zone id previously contained hostedzone/<zone_id>
This commit is contained in:
parent
22d9141122
commit
79e31e7287
@ -7,6 +7,6 @@ url_bases = [
|
|||||||
|
|
||||||
url_paths = {
|
url_paths = {
|
||||||
'{0}$': responses.list_or_create_hostzone_response,
|
'{0}$': responses.list_or_create_hostzone_response,
|
||||||
'{0}/.+$': responses.get_or_delete_hostzone_response,
|
'{0}/[^/]+$': responses.get_or_delete_hostzone_response,
|
||||||
'{0}/.+/rrset$': responses.rrset_response,
|
'{0}/[^/]+/rrset$': responses.rrset_response,
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import boto
|
import boto
|
||||||
from boto.exception import S3ResponseError
|
|
||||||
from boto.s3.key import Key
|
|
||||||
from boto.route53.record import ResourceRecordSets
|
from boto.route53.record import ResourceRecordSets
|
||||||
from freezegun import freeze_time
|
|
||||||
import requests
|
|
||||||
|
|
||||||
import sure # noqa
|
import sure # noqa
|
||||||
|
|
||||||
@ -19,11 +15,11 @@ def test_hosted_zone():
|
|||||||
zones = conn.get_all_hosted_zones()
|
zones = conn.get_all_hosted_zones()
|
||||||
len(zones["ListHostedZonesResponse"]["HostedZones"]).should.equal(1)
|
len(zones["ListHostedZonesResponse"]["HostedZones"]).should.equal(1)
|
||||||
|
|
||||||
secondzone = conn.create_hosted_zone("testdns1.aws.com")
|
conn.create_hosted_zone("testdns1.aws.com")
|
||||||
zones = conn.get_all_hosted_zones()
|
zones = conn.get_all_hosted_zones()
|
||||||
len(zones["ListHostedZonesResponse"]["HostedZones"]).should.equal(2)
|
len(zones["ListHostedZonesResponse"]["HostedZones"]).should.equal(2)
|
||||||
|
|
||||||
id1 = firstzone["CreateHostedZoneResponse"]["HostedZone"]["Id"]
|
id1 = firstzone["CreateHostedZoneResponse"]["HostedZone"]["Id"].split("/")[-1]
|
||||||
zone = conn.get_hosted_zone(id1)
|
zone = conn.get_hosted_zone(id1)
|
||||||
zone["GetHostedZoneResponse"]["HostedZone"]["Name"].should.equal("testdns.aws.com")
|
zone["GetHostedZoneResponse"]["HostedZone"]["Name"].should.equal("testdns.aws.com")
|
||||||
|
|
||||||
@ -38,11 +34,11 @@ def test_hosted_zone():
|
|||||||
def test_rrset():
|
def test_rrset():
|
||||||
conn = boto.connect_route53('the_key', 'the_secret')
|
conn = boto.connect_route53('the_key', 'the_secret')
|
||||||
|
|
||||||
conn.get_all_rrsets.when.called_with("abcd", type="A").\
|
conn.get_all_rrsets.when.called_with("abcd", type="A").should.throw(
|
||||||
should.throw(boto.route53.exception.DNSServerError, "404 Not Found")
|
boto.route53.exception.DNSServerError, "404 Not Found")
|
||||||
|
|
||||||
zone = conn.create_hosted_zone("testdns.aws.com")
|
zone = conn.create_hosted_zone("testdns.aws.com")
|
||||||
zoneid = zone["CreateHostedZoneResponse"]["HostedZone"]["Id"]
|
zoneid = zone["CreateHostedZoneResponse"]["HostedZone"]["Id"].split("/")[-1]
|
||||||
|
|
||||||
changes = ResourceRecordSets(conn, zoneid)
|
changes = ResourceRecordSets(conn, zoneid)
|
||||||
change = changes.add_change("CREATE", "foo.bar.testdns.aws.com", "A")
|
change = changes.add_change("CREATE", "foo.bar.testdns.aws.com", "A")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user