]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
merge salv's branch for bug834013
authorDan Wendlandt <dan@nicira.com>
Fri, 9 Sep 2011 15:59:55 +0000 (08:59 -0700)
committerDan Wendlandt <dan@nicira.com>
Fri, 9 Sep 2011 15:59:55 +0000 (08:59 -0700)
1  2 
quantum/api/api_common.py
quantum/client.py
tests/unit/test_api.py

index 6f0f5477e38c8e1870e61322bf9abbbbd4b62117,8b0fa0e62e4252a863d87006339572ce50446d74..0fb68696e8beb6b531cd26a852c3cfffc6e4eb42
@@@ -59,5 -60,23 +60,24 @@@ class QuantumController(wsgi.Controller
                      LOG.error(line)
                  raise exc.HTTPBadRequest(msg)
              results[param_name] = param_value or param.get('default-value')
 +
          return results
+     def _build_response(self, req, res_data, status_code=200):
+         """ A function which builds an HTTP response
+             given a status code and a dictionary containing
+             the response body to be serialized
+         """
+         content_type = req.best_match_content_type()
+         default_xmlns = self.get_default_xmlns(req)
+         body = self._serialize(res_data, content_type, default_xmlns)
+         response = webob.Response()
+         response.status = status_code
+         response.headers['Content-Type'] = content_type
+         response.body = body
+         msg_dict = dict(url=req.url, status=response.status_int)
+         msg = _("%(url)s returned with HTTP %(status)d") % msg_dict
+         LOG.debug(msg)
+         return response
Simple merge
Simple merge