yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #77249
[Bug 1817953] Re: oslopolicy-policy-generator does not work for neutron
Reviewed: https://review.openstack.org/639822
Committed: https://git.openstack.org/cgit/openstack/oslo.policy/commit/?id=61732757c0e934a7c61cef2b2d2651f5abbb6fc6
Submitter: Zuul
Branch: master
commit 61732757c0e934a7c61cef2b2d2651f5abbb6fc6
Author: Ben Nemec <bnemec@xxxxxxxxxx>
Date: Wed Feb 27 20:53:11 2019 +0000
Provide more specific error when namespace is missing
Previously if a non-existent namespace was specified, we just got
a generic KeyError from stevedore that didn't say a whole lot about
what went wrong. You pretty much had to go read the code to figure
out what happened.
This change adds an explicit check for a missing namespace and raises
a KeyError with a more specific error message that explains what is
wrong.
Change-Id: Ia56d4655d70cee78661567188a977f67b7c3ee78
Closes-Bug: 1817953
** Changed in: oslo.policy
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/1817953
Title:
oslopolicy-policy-generator does not work for neutron
Status in neutron:
New
Status in oslo.policy:
Fix Released
Bug description:
The oslopolicy-policy-generator tool does not work for neutron. This
appears to be the same as an old bug [1] that was already fixed for
other services.
[centos@persist devstack]$ oslopolicy-policy-generator --namespace neutron
WARNING:stevedore.named:Could not load neutron
Traceback (most recent call last):
File "/usr/bin/oslopolicy-policy-generator", line 11, in <module>
sys.exit(generate_policy())
File "/usr/lib/python2.7/site-packages/oslo_policy/generator.py", line 338, in generate_policy
_generate_policy(conf.namespace, conf.output_file)
File "/usr/lib/python2.7/site-packages/oslo_policy/generator.py", line 283, in _generate_policy
enforcer = _get_enforcer(namespace)
File "/usr/lib/python2.7/site-packages/oslo_policy/generator.py", line 87, in _get_enforcer
enforcer = mgr[namespace].obj
File "/usr/lib/python2.7/site-packages/stevedore/extension.py", line 326, in __getitem__
return self._extensions_by_name[name]
KeyError: 'neutron'
[1] https://bugs.launchpad.net/keystone/+bug/1740951
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1817953/+subscriptions
References