Merge pull request #1960 from tatsuyafw/add-trailing-dot-to-resource-record
Add a trailing dot to the Name of Route53 ResourceRecordSet
This commit is contained in:
commit
860dfbbe11
@ -123,6 +123,9 @@ class Route53(BaseResponse):
|
|||||||
""" % (record_set['Name'], the_zone.name)
|
""" % (record_set['Name'], the_zone.name)
|
||||||
return 400, headers, error_msg
|
return 400, headers, error_msg
|
||||||
|
|
||||||
|
if not record_set['Name'].endswith('.'):
|
||||||
|
record_set['Name'] += '.'
|
||||||
|
|
||||||
if action in ('CREATE', 'UPSERT'):
|
if action in ('CREATE', 'UPSERT'):
|
||||||
if 'ResourceRecords' in record_set:
|
if 'ResourceRecords' in record_set:
|
||||||
resource_records = list(
|
resource_records = list(
|
||||||
|
@ -164,8 +164,8 @@ def test_alias_rrset():
|
|||||||
rrsets = conn.get_all_rrsets(zoneid, type="A")
|
rrsets = conn.get_all_rrsets(zoneid, type="A")
|
||||||
rrset_records = [(rr_set.name, rr) for rr_set in rrsets for rr in rr_set.resource_records]
|
rrset_records = [(rr_set.name, rr) for rr_set in rrsets for rr in rr_set.resource_records]
|
||||||
rrset_records.should.have.length_of(2)
|
rrset_records.should.have.length_of(2)
|
||||||
rrset_records.should.contain(('foo.alias.testdns.aws.com', 'foo.testdns.aws.com'))
|
rrset_records.should.contain(('foo.alias.testdns.aws.com.', 'foo.testdns.aws.com'))
|
||||||
rrset_records.should.contain(('bar.alias.testdns.aws.com', 'bar.testdns.aws.com'))
|
rrset_records.should.contain(('bar.alias.testdns.aws.com.', 'bar.testdns.aws.com'))
|
||||||
rrsets[0].resource_records[0].should.equal('foo.testdns.aws.com')
|
rrsets[0].resource_records[0].should.equal('foo.testdns.aws.com')
|
||||||
rrsets = conn.get_all_rrsets(zoneid, type="CNAME")
|
rrsets = conn.get_all_rrsets(zoneid, type="CNAME")
|
||||||
rrsets.should.have.length_of(1)
|
rrsets.should.have.length_of(1)
|
||||||
@ -525,7 +525,7 @@ def test_change_resource_record_sets_crud_valid():
|
|||||||
{
|
{
|
||||||
'Action': 'CREATE',
|
'Action': 'CREATE',
|
||||||
'ResourceRecordSet': {
|
'ResourceRecordSet': {
|
||||||
'Name': 'prod.redis.db',
|
'Name': 'prod.redis.db.',
|
||||||
'Type': 'A',
|
'Type': 'A',
|
||||||
'TTL': 10,
|
'TTL': 10,
|
||||||
'ResourceRecords': [{
|
'ResourceRecords': [{
|
||||||
@ -540,7 +540,7 @@ def test_change_resource_record_sets_crud_valid():
|
|||||||
response = conn.list_resource_record_sets(HostedZoneId=hosted_zone_id)
|
response = conn.list_resource_record_sets(HostedZoneId=hosted_zone_id)
|
||||||
len(response['ResourceRecordSets']).should.equal(1)
|
len(response['ResourceRecordSets']).should.equal(1)
|
||||||
a_record_detail = response['ResourceRecordSets'][0]
|
a_record_detail = response['ResourceRecordSets'][0]
|
||||||
a_record_detail['Name'].should.equal('prod.redis.db')
|
a_record_detail['Name'].should.equal('prod.redis.db.')
|
||||||
a_record_detail['Type'].should.equal('A')
|
a_record_detail['Type'].should.equal('A')
|
||||||
a_record_detail['TTL'].should.equal(10)
|
a_record_detail['TTL'].should.equal(10)
|
||||||
a_record_detail['ResourceRecords'].should.equal([{'Value': '127.0.0.1'}])
|
a_record_detail['ResourceRecords'].should.equal([{'Value': '127.0.0.1'}])
|
||||||
@ -552,7 +552,7 @@ def test_change_resource_record_sets_crud_valid():
|
|||||||
{
|
{
|
||||||
'Action': 'UPSERT',
|
'Action': 'UPSERT',
|
||||||
'ResourceRecordSet': {
|
'ResourceRecordSet': {
|
||||||
'Name': 'prod.redis.db',
|
'Name': 'prod.redis.db.',
|
||||||
'Type': 'CNAME',
|
'Type': 'CNAME',
|
||||||
'TTL': 60,
|
'TTL': 60,
|
||||||
'ResourceRecords': [{
|
'ResourceRecords': [{
|
||||||
@ -567,7 +567,7 @@ def test_change_resource_record_sets_crud_valid():
|
|||||||
response = conn.list_resource_record_sets(HostedZoneId=hosted_zone_id)
|
response = conn.list_resource_record_sets(HostedZoneId=hosted_zone_id)
|
||||||
len(response['ResourceRecordSets']).should.equal(1)
|
len(response['ResourceRecordSets']).should.equal(1)
|
||||||
cname_record_detail = response['ResourceRecordSets'][0]
|
cname_record_detail = response['ResourceRecordSets'][0]
|
||||||
cname_record_detail['Name'].should.equal('prod.redis.db')
|
cname_record_detail['Name'].should.equal('prod.redis.db.')
|
||||||
cname_record_detail['Type'].should.equal('CNAME')
|
cname_record_detail['Type'].should.equal('CNAME')
|
||||||
cname_record_detail['TTL'].should.equal(60)
|
cname_record_detail['TTL'].should.equal(60)
|
||||||
cname_record_detail['ResourceRecords'].should.equal([{'Value': '192.168.1.1'}])
|
cname_record_detail['ResourceRecords'].should.equal([{'Value': '192.168.1.1'}])
|
||||||
@ -688,12 +688,12 @@ def test_list_resource_record_sets_name_type_filters():
|
|||||||
|
|
||||||
# record_type, record_name
|
# record_type, record_name
|
||||||
all_records = [
|
all_records = [
|
||||||
('A', 'a.a.db'),
|
('A', 'a.a.db.'),
|
||||||
('A', 'a.b.db'),
|
('A', 'a.b.db.'),
|
||||||
('A', 'b.b.db'),
|
('A', 'b.b.db.'),
|
||||||
('CNAME', 'b.b.db'),
|
('CNAME', 'b.b.db.'),
|
||||||
('CNAME', 'b.c.db'),
|
('CNAME', 'b.c.db.'),
|
||||||
('CNAME', 'c.c.db')
|
('CNAME', 'c.c.db.')
|
||||||
]
|
]
|
||||||
for record_type, record_name in all_records:
|
for record_type, record_name in all_records:
|
||||||
create_resource_record_set(record_type, record_name)
|
create_resource_record_set(record_type, record_name)
|
||||||
|
Loading…
Reference in New Issue
Block a user