|
# TODO validate |
|
z_vpc_id = z.get('HostedZone', {}) \ |
|
.get('VPCs', {}) \ |
|
.get('VPC', {}) \ |
|
.get('VPCId', '') |
The actual response contains (amongst other fields):
{'HostedZone': {'Id': '/hostedzone/ASDFASDFASDF', 'Name': 'asdfasdf.', 'Config': {'Comment': 'Internal domains', 'PrivateZone': True}, 'ResourceRecordSetCount': 56}, 'VPCs': [{'VPCRegion': 'us-east-1', 'VPCId': 'vpc-asdf1'}, {'VPCRegion': 'us-west-1', 'VPCId': 'vpc-asdf2'}, {'VPCRegion': 'us-west-1', 'VPCId': 'vpc-asdf3'}, {'VPCRegion': 'us-west-2', 'VPCId': 'vpc-asdf4'}]}
As such, it should iterate for each returned VPC in the list, something like:
for v in z.get('VPCs', []):
if requested_vpc_id and v['VPCId'] == requested_vpc_id:
return data
route53-transfer-ng/route53_transfer/app.py
Lines 105 to 109 in 58878d8
The actual response contains (amongst other fields):
{'HostedZone': {'Id': '/hostedzone/ASDFASDFASDF', 'Name': 'asdfasdf.', 'Config': {'Comment': 'Internal domains', 'PrivateZone': True}, 'ResourceRecordSetCount': 56}, 'VPCs': [{'VPCRegion': 'us-east-1', 'VPCId': 'vpc-asdf1'}, {'VPCRegion': 'us-west-1', 'VPCId': 'vpc-asdf2'}, {'VPCRegion': 'us-west-1', 'VPCId': 'vpc-asdf3'}, {'VPCRegion': 'us-west-2', 'VPCId': 'vpc-asdf4'}]}As such, it should iterate for each returned VPC in the list, something like: