Bug 1572317 - Unable to dump policy using oslopolicy-policy-generator
Summary: Unable to dump policy using oslopolicy-policy-generator
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-keystone
Version: 12.0 (Pike)
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: z1
: 13.0 (Queens)
Assignee: Harry Rybacki
QA Contact: Pavan
URL:
Whiteboard:
Depends On:
Blocks: 1577361 1577965
TreeView+ depends on / blocked
 
Reported: 2018-04-26 16:28 UTC by David Hill
Modified: 2018-07-23 10:34 UTC (History)
10 users (show)

Fixed In Version: openstack-keystone-13.0.1-0.20180420194847.7bd6454.el7ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1577361 1577965 (view as bug list)
Environment:
Last Closed: 2018-07-23 10:34:50 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1740951 0 None None None 2018-04-26 16:29:23 UTC
OpenStack gerrit 530828 0 'None' MERGED Expose a get_enforcer method for oslo.policy scripts 2021-01-17 09:45:57 UTC
Red Hat Knowledge Base (Solution) 3182981 0 None None None 2018-04-26 16:40:11 UTC

Description David Hill 2018-04-26 16:28:58 UTC
Description of problem:
Unable to dump policy using oslopolicy-policy-generator.  This seems to be fixed upstream.

# oslopolicy-policy-generator --namespace keystone
WARNING:stevedore.named:Could not load keystone
Traceback (most recent call last):
  File "/openstack/venvs/keystone-16.0.6/bin/oslopolicy-policy-generator", line 11, in <module>
    sys.exit(generate_policy())
  File "/openstack/venvs/keystone-16.0.6/lib/python2.7/site-packages/oslo_policy/generator.py", line 233, in generate_policy
    _generate_policy(conf.namespace, conf.output_file)
  File "/openstack/venvs/keystone-16.0.6/lib/python2.7/site-packages/oslo_policy/generator.py", line 178, in _generate_policy
    enforcer = _get_enforcer(namespace)
  File "/openstack/venvs/keystone-16.0.6/lib/python2.7/site-packages/oslo_policy/generator.py", line 74, in _get_enforcer
    enforcer = mgr[namespace].obj
  File "/openstack/venvs/keystone-16.0.6/lib/python2.7/site-packages/stevedore/extension.py", line 314, in __getitem__
    return self._extensions_by_name[name]
KeyError: 'keystone'

[1] https://bugs.launchpad.net/keystone/+bug/1740951

Version-Release number of selected component (if applicable):


How reproducible:
Install RHOSP 12

Steps to Reproduce:
1. Try generate a policy other than nova like keystone, heat, cinder or glance
2.
3.

Actual results:
Fails

Expected results:
Succeeds

Additional info:

Comment 1 David Hill 2018-04-26 16:37:39 UTC
[root@controller-0 ~]# docker exec nova_api oslopolicy-policy-generator --namespace keystone
WARNING:stevedore.named:Could not load keystone
Traceback (most recent call last):
  File "/usr/bin/oslopolicy-policy-generator", line 10, in <module>
    sys.exit(generate_policy())
  File "/usr/lib/python2.7/site-packages/oslo_policy/generator.py", line 233, in generate_policy
    _generate_policy(conf.namespace, conf.output_file)
  File "/usr/lib/python2.7/site-packages/oslo_policy/generator.py", line 178, in _generate_policy
    enforcer = _get_enforcer(namespace)
  File "/usr/lib/python2.7/site-packages/oslo_policy/generator.py", line 74, in _get_enforcer
    enforcer = mgr[namespace].obj
  File "/usr/lib/python2.7/site-packages/stevedore/extension.py", line 314, in __getitem__
    return self._extensions_by_name[name]
KeyError: 'keystone'
[root@controller-0 ~]# oslopolicy-policy-generator --namespace keystone
WARNING:stevedore.named:Could not load keystone
Traceback (most recent call last):
  File "/bin/oslopolicy-policy-generator", line 10, in <module>
    sys.exit(generate_policy())
  File "/usr/lib/python2.7/site-packages/oslo_policy/generator.py", line 233, in generate_policy
    _generate_policy(conf.namespace, conf.output_file)
  File "/usr/lib/python2.7/site-packages/oslo_policy/generator.py", line 178, in _generate_policy
    enforcer = _get_enforcer(namespace)
  File "/usr/lib/python2.7/site-packages/oslo_policy/generator.py", line 74, in _get_enforcer
    enforcer = mgr[namespace].obj
  File "/usr/lib/python2.7/site-packages/stevedore/extension.py", line 314, in __getitem__
    return self._extensions_by_name[name]
KeyError: 'keystone'

Comment 2 David Hill 2018-04-26 16:49:37 UTC
This is true for RHOSP 10 as well.

Comment 3 Victor Stinner 2018-04-27 09:52:31 UTC
https://bugs.launchpad.net/keystone/+bug/1740951
https://review.openstack.org/#/c/534396/

The keystone change has already been backported upstream in Openstack Pike (OSP 12) 2 months ago, but I see no release including it. The latest release for Pike is Keystone 12.0.0 if I read correctly.

It seems like the issue is specific to Keystone, so I reassign the issue to Keystone.

Comment 8 Jon Schlueter 2018-06-27 19:40:59 UTC
According to our records, this should be resolved by openstack-keystone-13.0.1-0.20180420194847.7bd6454.el7ost.  This build is available now.


Note You need to log in before you can comment on or make changes to this bug.