Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/next-release/bugfix-Route53-3033.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "bugfix",
"category": "Route53",
"description": "Fixed AttributeError in fix_route53_ids when a Route53 resource ID parameter (e.g. HostedZoneId) is None. Non-string values are now passed through to normal parameter validation."
}
2 changes: 1 addition & 1 deletion botocore/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ def fix_route53_ids(params, model, **kwargs):
]

for name in members:
if name in params:
if name in params and isinstance(params[name], str):
orig_value = params[name]
params[name] = orig_value.split('/')[-1]
logger.debug('%s %s -> %s', name, orig_value, params[name])
Expand Down
23 changes: 23 additions & 0 deletions tests/unit/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,29 @@ def test_route53_resource_id_missing_input_shape(self):

self.assertEqual(params['HostedZoneId'], '/hostedzone/ABC123')

def test_route53_resource_id_non_string_left_alone(self):
event = 'before-parameter-build.route53.GetHostedZone'
params = {'HostedZoneId': None}
operation_def = {
'name': 'GetHostedZone',
'input': {'shape': 'GetHostedZoneInput'},
}
service_def = {
'metadata': {},
'shapes': {
'GetHostedZoneInput': {
'type': 'structure',
'members': {
'HostedZoneId': {'shape': 'ResourceId'},
},
},
'ResourceId': {'type': 'string'},
},
}
model = OperationModel(operation_def, ServiceModel(service_def))
self.session.emit(event, params=params, model=model)
self.assertIsNone(params['HostedZoneId'])

def test_run_instances_userdata(self):
user_data = 'This is a test'
b64_user_data = base64.b64encode(user_data.encode('latin-1')).decode(
Expand Down