def action_match(environ, result):
req = Request(environ)
- env_action = req.GET.get("Action")
+ env_action = req.params.get("Action")
return env_action == api_action
return {'function': action_match}
except rpc_common.RemoteError as ex:
return webob.exc.HTTPBadRequest(str(ex))
- return {'CreateStackResult': self._stackid_addprefix(res)}
+ # Note boto expects CreateStackResult wrapped in CreateStackResponse
+ # CreateStackResponse is not mentioned in the aws API docs, so we
+ # need to check against a real AWS response to ensure this is correct
+ return {'CreateStackResponse':
+ {'CreateStackResult': self._stackid_addprefix(res)}}
def get_template(self, req):
return obj.isoformat()
return obj
- return json.dumps(data, default=sanitizer)
+ response = json.dumps(data, default=sanitizer)
+ logging.debug("JSON response : %s" % response)
+ return response
def default(self, response, result):
response.content_type = 'application/json'
eltree = etree.Element(root)
doc = etree.ElementTree(eltree)
self.object_to_element(data.get(root), eltree)
- logging.debug("XML response : %s" % etree.tostring(eltree))
- return etree.tostring(eltree)
+ response = etree.tostring(eltree)
+ logging.debug("XML response : %s" % response)
+ return response
def default(self, response, result):
response.content_type = 'application/xml'
# would appear that the default response serialization is XML, as
# described in the API docs, but passing a query parameter of
# ContentType=JSON results in a JSON serialized response...
- content_type = request.GET.get("ContentType")
+ content_type = request.params.get("ContentType")
deserialized_request = self.dispatch(self.deserializer,
action, request)