Make _get_multi_param smarter.
This commit is contained in:
parent
ae2898b382
commit
c6cb503b61
@ -10,7 +10,7 @@ class AutoScalingResponse(BaseResponse):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def autoscaling_backend(self):
|
def autoscaling_backend(self):
|
||||||
return autoscaling_backends[self.region]
|
return autoscaling_backends[self.region]
|
||||||
|
|
||||||
def _get_int_param(self, param_name):
|
def _get_int_param(self, param_name):
|
||||||
value = self._get_param(param_name)
|
value = self._get_param(param_name)
|
||||||
@ -56,7 +56,7 @@ class AutoScalingResponse(BaseResponse):
|
|||||||
return template.render()
|
return template.render()
|
||||||
|
|
||||||
def describe_launch_configurations(self):
|
def describe_launch_configurations(self):
|
||||||
names = self._get_multi_param('LaunchConfigurationNames')
|
names = self._get_multi_param('LaunchConfigurationNames.member')
|
||||||
launch_configurations = self.autoscaling_backend.describe_launch_configurations(names)
|
launch_configurations = self.autoscaling_backend.describe_launch_configurations(names)
|
||||||
template = Template(DESCRIBE_LAUNCH_CONFIGURATIONS_TEMPLATE)
|
template = Template(DESCRIBE_LAUNCH_CONFIGURATIONS_TEMPLATE)
|
||||||
return template.render(launch_configurations=launch_configurations)
|
return template.render(launch_configurations=launch_configurations)
|
||||||
@ -87,7 +87,7 @@ class AutoScalingResponse(BaseResponse):
|
|||||||
return template.render()
|
return template.render()
|
||||||
|
|
||||||
def describe_auto_scaling_groups(self):
|
def describe_auto_scaling_groups(self):
|
||||||
names = self._get_multi_param("AutoScalingGroupNames")
|
names = self._get_multi_param("AutoScalingGroupNames.member")
|
||||||
groups = self.autoscaling_backend.describe_autoscaling_groups(names)
|
groups = self.autoscaling_backend.describe_autoscaling_groups(names)
|
||||||
template = Template(DESCRIBE_AUTOSCALING_GROUPS_TEMPLATE)
|
template = Template(DESCRIBE_AUTOSCALING_GROUPS_TEMPLATE)
|
||||||
return template.render(groups=groups)
|
return template.render(groups=groups)
|
||||||
|
@ -112,8 +112,16 @@ class BaseResponse(object):
|
|||||||
prefix = param_prefix
|
prefix = param_prefix
|
||||||
else:
|
else:
|
||||||
prefix = param_prefix + "."
|
prefix = param_prefix + "."
|
||||||
return [value[0] for key, value in self.querystring.items()
|
values = []
|
||||||
if key.startswith(prefix)]
|
index = 1
|
||||||
|
while True:
|
||||||
|
try:
|
||||||
|
values.append(self.querystring[prefix + str(index)][0])
|
||||||
|
except KeyError:
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
index += 1
|
||||||
|
return values
|
||||||
|
|
||||||
|
|
||||||
def metadata_response(request, full_url, headers):
|
def metadata_response(request, full_url, headers):
|
||||||
|
Loading…
Reference in New Issue
Block a user