try:
return template_format.parse(data)
except ValueError:
- err_reason = "%s not in valid format" % data_type
- raise exc.HTTPBadRequest(explanation=err_reason)
+ err_reason = _("%s not in valid format") % data_type
+ raise exc.HTTPBadRequest(err_reason)
def stack_name(self):
"""
Return the stack name.
"""
if self.PARAM_STACK_NAME not in self.data:
- raise exc.HTTPBadRequest(explanation=_("No stack name specified"))
+ raise exc.HTTPBadRequest(_("No stack name specified"))
return self.data[self.PARAM_STACK_NAME]
def template(self):
template_data = urlfetch.get(url)
except IOError as ex:
err_reason = _('Could not retrieve template: %s') % str(ex)
- raise exc.HTTPBadRequest(explanation=err_reason)
+ raise exc.HTTPBadRequest(err_reason)
else:
- raise exc.HTTPBadRequest(explanation=_("No template specified"))
+ raise exc.HTTPBadRequest(_("No template specified"))
return self.format_parse(template_data, 'Template')
return util.remote_error(ex)
if 'Description' in result:
- raise exc.HTTPBadRequest(explanation=result['Description'])
+ raise exc.HTTPBadRequest(result['Description'])
raise exc.HTTPCreated(location=util.make_url(req, result))
return util.remote_error(ex)
if 'Description' in res:
- raise exc.HTTPBadRequest(explanation=res['Description'])
+ raise exc.HTTPBadRequest(res['Description'])
raise exc.HTTPAccepted()
return util.remote_error(ex)
if res is not None:
- raise exc.HTTPBadRequest(explanation=res['Error'])
+ raise exc.HTTPBadRequest(res['Error'])
raise exc.HTTPNoContent()
return util.remote_error(ex)
if 'Error' in result:
- raise exc.HTTPBadRequest(explanation=result['Error'])
+ raise exc.HTTPBadRequest(result['Error'])
return result
try:
types = self.engine.list_resource_types(req.context)
except rpc_common.RemoteError as ex:
- raise exc.HTTPInternalServerError(explanation=str(ex))
+ raise exc.HTTPInternalServerError(str(ex))
return {'resource_types': types}
stack_identity = identifier.HeatIdentifier(**identity)
except ValueError:
err_reason = _('Invalid Stack address')
- raise exc.HTTPInternalServerError(explanation=err_reason)
+ raise exc.HTTPInternalServerError(err_reason)
return req.relative_url(stack_identity.url_path(), True)
Exc = error_map.get(ex.exc_type, exc.HTTPInternalServerError)
- raise Exc(explanation=str(ex))
+ raise Exc(str(ex))