Reviewed: https://review.openstack.org/443342 Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=4c40016dfba21a851d1cac5ce199ddcca001562b Submitter: Jenkins Branch: master
commit 4c40016dfba21a851d1cac5ce199ddcca001562b Author: Kevin Benton <[email protected]> Date: Wed Mar 8 14:43:28 2017 -0800 Init policy in pecan after hook as well policy.init() is called in the before hook, but this isn't invoked on GET calls so if the first call a thread receives is a GET call, we can end up with an uninitialized policy enforcer and get a traceback. This just calls policy.init() in the after hook as well. Change-Id: I29ebc9a91b98a27e707d5b35ad1a24a26e8c8f44 Closes-Bug: #1671267 ** Changed in: neutron Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to neutron. https://bugs.launchpad.net/bugs/1671267 Title: pecan path leaves policy engine uninitialized Status in neutron: Fix Released Bug description: Traceback in pecan gate run. http://logs.openstack.org/35/393535/25/check/gate-grenade-dsvm- neutron-ubuntu-xenial/9867d01/logs/new/screen-q-svc.txt.gz 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors Traceback (most recent call last): 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors File "/usr/local/lib/python2.7/dist-packages/oslo_middleware/catch_errors.py", line 41, in __call__ 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors response = req.get_response(self.application) 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1299, in send 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors application, catch_exc_info=False) 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1263, in call_application 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors app_iter = application(self.environ, start_response) 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__ 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors resp = self.call_func(req, *args, **self.kwargs) 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors return self.func(req, *args, **kwargs) 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors File "/usr/local/lib/python2.7/dist-packages/keystonemiddleware/auth_token/__init__.py", line 335, in __call__ 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors response = req.get_response(self._app) 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1299, in send 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors application, catch_exc_info=False) 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1263, in call_application 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors app_iter = application(self.environ, start_response) 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__ 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors return resp(environ, start_response) 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__ 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors return resp(environ, start_response) 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors File "/usr/local/lib/python2.7/dist-packages/routes/middleware.py", line 141, in __call__ 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors response = self.app(environ, start_response) 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__ 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors return resp(environ, start_response) 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors File "/usr/local/lib/python2.7/dist-packages/pecan/middleware/recursive.py", line 56, in __call__ 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors return self.application(environ, start_response) 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors File "/usr/local/lib/python2.7/dist-packages/pecan/core.py", line 840, in __call__ 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors return super(Pecan, self).__call__(environ, start_response) 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors File "/usr/local/lib/python2.7/dist-packages/pecan/core.py", line 736, in __call__ 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors state 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors File "/usr/local/lib/python2.7/dist-packages/pecan/core.py", line 865, in handle_hooks 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors return super(Pecan, self).handle_hooks(hooks, *args, **kw) 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors File "/usr/local/lib/python2.7/dist-packages/pecan/core.py", line 342, in handle_hooks 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors result = getattr(hook, hook_type)(*args) 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors File "/opt/stack/new/neutron/neutron/pecan_wsgi/hooks/policy_enforcement.py", line 185, in after 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors pluralized=collection))] 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors File "/opt/stack/new/neutron/neutron/policy.py", line 368, in check 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors result = _ENFORCER.enforce(match_rule, 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors AttributeError: 'NoneType' object has no attribute 'enforce' 2017-03-08 17:32:36.121 23954 ERROR oslo_middleware.catch_errors To manage notifications about this bug go to: https://bugs.launchpad.net/neutron/+bug/1671267/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

