This commit is contained in:
Alex Meade 2011-06-14 13:27:28 -04:00
parent e9f6e47a92
commit cf66a99314
2 changed files with 3 additions and 3 deletions

View File

@ -77,7 +77,7 @@ class JSONDeserializer(TextDeserializer):
return utils.loads(datastring) return utils.loads(datastring)
except ValueError: except ValueError:
raise exception.MalformedRequestBody( raise exception.MalformedRequestBody(
"malformed JSON in request body") reason=_("malformed JSON in request body"))
class XMLDeserializer(TextDeserializer): class XMLDeserializer(TextDeserializer):
@ -98,7 +98,7 @@ class XMLDeserializer(TextDeserializer):
return {node.nodeName: self._from_xml_node(node, plurals)} return {node.nodeName: self._from_xml_node(node, plurals)}
except ExpatError: except ExpatError:
raise exception.MalformedRequestBody( raise exception.MalformedRequestBody(
"malformed XML in request Body") reason=_("malformed XML in request body"))
def _from_xml_node(self, node, listnames): def _from_xml_node(self, node, listnames):
"""Convert a minidom node to a simple Python type. """Convert a minidom node to a simple Python type.

View File

@ -588,4 +588,4 @@ class MigrationError(NovaException):
class MalformedRequestBody(NovaException): class MalformedRequestBody(NovaException):
message = _("Malformed message body") + ": %(reason)s" message = _("Malformed message body: %(reason)s")