gnocchixyz / gnocchi

Timeseries database
Apache License 2.0
299 stars 85 forks source link

Gnocchi does not provide oslo.policy.enforcer entry point #1291

Closed pshchelo closed 1 year ago

pshchelo commented 1 year ago

oslo.policy.enforcer entry point is needed for various scripts available in oslo.policy library to function, for example oslopolicy-policy-generator to list actual policies in effect (defaults in code + overrides from explicit policy files).

Currently these scripts do not work with Gnocchi:

$ oslopolicy-policy-generator --namespace gnocchi
WARNING:stevedore.named:Could not load gnocchi
Traceback (most recent call last):
  File "/var/lib/openstack/bin/oslopolicy-policy-generator", line 8, in <module>
    sys.exit(generate_policy())
  File "/var/lib/openstack/lib/python3.8/site-packages/oslo_policy/generator.py", line 533, in generate_policy
    _generate_policy(conf.namespace, conf.output_file)
  File "/var/lib/openstack/lib/python3.8/site-packages/oslo_policy/generator.py", line 327, in _generate_policy
    enforcer = _get_enforcer(namespace)
  File "/var/lib/openstack/lib/python3.8/site-packages/oslo_policy/generator.py", line 104, in _get_enforcer
    raise KeyError('Namespace "%s" not found.' % namespace)
KeyError: 'Namespace "gnocchi" not found.'

https://docs.openstack.org/oslo.policy/latest/cli/index.html