Fixed how parameters are passed in following clarification on GitHub comments.

This commit is contained in:
Mike Grima 2015-02-27 12:22:31 -08:00
parent 3a357c0fe3
commit 70315fd67c
2 changed files with 3 additions and 5 deletions

View File

@ -137,10 +137,7 @@ class BaseResponse(_TemplateEnvironmentMixin):
if action in method_names:
method = getattr(self, action)
try:
if action != 'list_instance_profiles_for_role':
response = method()
else:
response = method(role_name=self.querystring['RoleName'][0])
response = method()
except HTTPException as http_error:
response = http_error.description, dict(status=http_error.code)
if isinstance(response, six.string_types):

View File

@ -87,7 +87,8 @@ class IamResponse(BaseResponse):
template = self.response_template(LIST_INSTANCE_PROFILES_TEMPLATE)
return template.render(instance_profiles=profiles)
def list_instance_profiles_for_role(self, role_name=None):
def list_instance_profiles_for_role(self):
role_name = self._get_param('RoleName')
profiles = iam_backend.get_instance_profiles_for_role(role_name=role_name)
template = self.response_template(LIST_INSTANCE_PROFILES_FOR_ROLE_TEMPLATE)