~james-page/ubuntu/raring/nova/myfixes

« back to all changes in this revision

Viewing changes to nova/api/openstack/wsgi.py

  • Committer: James Page
  • Author(s): Adam Gandelman, Adam Gandelman, Chuck Short
  • Date: 2012-10-31 13:49:10 UTC
  • mfrom: (1.1.66)
  • Revision ID: james.page@canonical.com-20121031134910-ifumii7temgy4vmd
Tags: 2013.1~g1~20121120.17206-0ubuntu1
[ Adam Gandelman ]
* debian/control: Ensure novaclient is upgraded with nova,
  require python-keystoneclient >= 1:2.9.0. (LP: #1073289)
* debian/patches/{ubuntu/*, rbd-security.patch}: Dropped, applied
  upstream.
* debian/control: Add python-testtools to Build-Depends.

[ Chuck Short ]
* New upstream version.
* Refreshed debian/patches/avoid_setuptools_git_dependency.patch.
* debian/rules: FTBFS if missing binaries.
* debian/nova-scheudler.install: Add missing rabbit-queues and
  nova-rpc-zmq-receiver.
* Remove nova-volume since it doesnt exist anymore, transition to cinder-*.
* debian/rules: install apport hook in the right place.
* debian/patches/ubuntu-show-tests.patch: Display test failures.
* debian/control: Add depends on genisoimage
* debian/control: Suggest guestmount.
* debian/control: Suggest websockify. (LP: #1076442)
* debian/nova.conf: Disable nova-volume service.
* debian/control: Depend on xen-system-* rather than the hypervisor.
* debian/control, debian/mans/nova-conductor.8, debian/nova-conductor.init,
  debian/nova-conductor.install, debian/nova-conductor.logrotate
  debian/nova-conductor.manpages, debian/nova-conductor.postrm
  debian/nova-conductor.upstart.in: Add nova-conductor service.
* debian/control: Add python-fixtures as a build deps.

Show diffs side-by-side

added added

removed removed

Lines of Context:
244
244
                                                                 listnames)
245
245
            return result
246
246
 
 
247
    def find_first_child_named_in_namespace(self, parent, namespace, name):
 
248
        """Search a nodes children for the first child with a given name"""
 
249
        for node in parent.childNodes:
 
250
            if (node.localName == name and
 
251
                node.namespaceURI and
 
252
                node.namespaceURI == namespace):
 
253
                return node
 
254
        return None
 
255
 
247
256
    def find_first_child_named(self, parent, name):
248
257
        """Search a nodes children for the first child with a given name"""
249
258
        for node in parent.childNodes:
250
 
            if node.nodeName == name:
 
259
            if node.localName == name:
251
260
                return node
252
261
        return None
253
262
 
254
263
    def find_children_named(self, parent, name):
255
264
        """Return all of a nodes children who have the given name"""
256
265
        for node in parent.childNodes:
257
 
            if node.nodeName == name:
 
266
            if node.localName == name:
258
267
                yield node
259
268
 
260
269
    def extract_text(self, node):
881
890
        #            function.  If we try to audit __call__(), we can
882
891
        #            run into troubles due to the @webob.dec.wsgify()
883
892
        #            decorator.
884
 
        return self._process_stack(request, action, action_args,
 
893
        try:
 
894
            return self._process_stack(request, action, action_args,
885
895
                                   content_type, body, accept)
 
896
        except expat.ExpatError:
 
897
            msg = _("Invalid XML in request body")
 
898
            return Fault(webob.exc.HTTPBadRequest(explanation=msg))
 
899
        except LookupError as e:
 
900
        #NOTE(Vijaya Erukala): XML input such as
 
901
        #                      <?xml version="1.0" encoding="TF-8"?>
 
902
        #                      raises LookupError: unknown encoding: TF-8
 
903
            return Fault(webob.exc.HTTPBadRequest(explanation=unicode(e)))
886
904
 
887
905
    def _process_stack(self, request, action, action_args,
888
906
                       content_type, body, accept):
998
1016
                meth = getattr(self.controller, action)
999
1017
        except AttributeError:
1000
1018
            if (not self.wsgi_actions or
1001
 
                action not in ['action', 'create', 'delete']):
 
1019
                action not in ['action', 'create', 'delete', 'update',
 
1020
                               'show']):
1002
1021
                # Propagate the error
1003
1022
                raise
1004
1023
        else:
1162
1181
                'code': code,
1163
1182
                'message': self.wrapped_exc.explanation}}
1164
1183
        if code == 413:
1165
 
            retry = self.wrapped_exc.headers['Retry-After']
1166
 
            fault_data[fault_name]['retryAfter'] = retry
 
1184
            retry = self.wrapped_exc.headers.get('Retry-After', None)
 
1185
            if retry:
 
1186
                fault_data[fault_name]['retryAfter'] = retry
1167
1187
 
1168
1188
        # 'code' is an attribute on the fault tag itself
1169
1189
        metadata = {'attributes': {fault_name: 'code'}}