title = "SignatureDoesNotMatch"
explanation = ("The request signature we calculated does not match the " +
"signature you provided")
+
+
+def map_remote_error(ex):
+ """
+ Map rpc_common.RemoteError exceptions returned by the engine
+ to HeatAPIException subclasses which can be used to return
+ properly formatted AWS error responses
+ """
+ if ex.exc_type in ('AttributeError', 'ValueError'):
+ # Attribute/Value error, bad user data, ex.value should tell us why
+ return HeatInvalidParameterValueError(detail=ex.value)
+ else:
+ # Map everything else to internal server error for now
+ # FIXME : further investigation into engine errors required
+ return HeatInternalFailureError(detail=ex.value)
"""
return {'%sResponse' % action: {'%sResult' % action: response}}
- def _remote_error(self, ex):
- """
- Map rpc_common.RemoteError exceptions returned by the engine
- to HeatAPIException subclasses which can be used to return
- properly formatted AWS error responses
- """
- if ex.exc_type in ('AttributeError', 'ValueError'):
- # Attribute/Value error, bad user data, ex.value should tell us why
- return exception.HeatInvalidParameterValueError(detail=ex.value)
- else:
- # Map everything else to internal server error for now
- # FIXME : further investigation into engine errors required
- return exception.HeatInternalFailureError(detail=ex.value)
-
@staticmethod
def _extract_user_params(params):
"""
stack_name=None,
params=parms)
except rpc_common.RemoteError as ex:
- return self._remote_error(ex)
+ return exception.map_remote_error(ex)
res = {'StackSummaries': [format_stack_summary(s)
for s in stack_list['stacks']]}
params=parms)
except rpc_common.RemoteError as ex:
- return self._remote_error(ex)
+ return exception.map_remote_error(ex)
res = {'Stacks': [format_stack(s) for s in stack_list['stacks']]}
params=stack_parms,
args=create_args)
except rpc_common.RemoteError as ex:
- return self._remote_error(ex)
+ return exception.map_remote_error(ex)
return self._format_response(action, self._stackid_addprefix(res))
stack_name=req.params['StackName'],
params=parms)
except rpc_common.RemoteError as ex:
- return self._remote_error(ex)
+ return exception.map_remote_error(ex)
if templ is None:
msg = _('stack not not found')
template=stack,
params=parms)
except rpc_common.RemoteError as ex:
- return self._remote_error(ex)
+ return exception.map_remote_error(ex)
def delete(self, req):
"""
cast=False)
except rpc_common.RemoteError as ex:
- return self._remote_error(ex)
+ return exception.map_remote_error(ex)
if res is None:
return self._format_response('DeleteStack', '')
stack_name=stack_name,
params=parms)
except rpc_common.RemoteError as ex:
- return self._remote_error(ex)
+ return exception.map_remote_error(ex)
events = 'Error' not in event_res and event_res['events'] or []
resource_name=req.params.get('LogicalResourceId'))
except rpc_common.RemoteError as ex:
- return self._remote_error(ex)
+ return exception.map_remote_error(ex)
result = format_resource_detail(resource_details)
logical_resource_id=req.params.get('LogicalResourceId'))
except rpc_common.RemoteError as ex:
- return self._remote_error(ex)
+ return exception.map_remote_error(ex)
result = [format_stack_resource(r) for r in resources]
resources = self.engine_rpcapi.list_stack_resources(con,
stack_name=req.params.get('StackName'))
except rpc_common.RemoteError as ex:
- return self._remote_error(ex)
+ return exception.map_remote_error(ex)
summaries = [format_resource_summary(r) for r in resources]