oslo policy generator tool fail for magnum

Bug #2068519 reported by Ghanshyam Mann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Magnum
Fix Released
Undecided
Ghanshyam Mann

Bug Description

oslo tool to generate the policy or sample policy file does not work for magnum service.

oslopolicy-policy-generator --namespace magnum

os@os-VirtualBox:/opt/stack/magnum$ oslopolicy-policy-generator --namespace magnum
Traceback (most recent call last):
  File "/usr/local/bin/oslopolicy-policy-generator", line 8, in <module>
    sys.exit(generate_policy())
  File "/usr/local/lib/python3.10/dist-packages/oslo_policy/generator.py", line 560, in generate_policy
    _generate_policy(conf.namespace, conf.output_file,
  File "/usr/local/lib/python3.10/dist-packages/oslo_policy/generator.py", line 350, in _generate_policy
    enforcer = _get_enforcer(namespace)
  File "/usr/local/lib/python3.10/dist-packages/oslo_policy/generator.py", line 102, in _get_enforcer
    mgr = stevedore.named.NamedExtensionManager(
  File "/usr/local/lib/python3.10/dist-packages/stevedore/named.py", line 78, in __init__
    extensions = self._load_plugins(invoke_on_load,
  File "/usr/local/lib/python3.10/dist-packages/stevedore/extension.py", line 218, in _load_plugins
    self._on_load_failure_callback(self, ep, err)
  File "/usr/local/lib/python3.10/dist-packages/stevedore/extension.py", line 206, in _load_plugins
    ext = self._load_one_plugin(ep,
  File "/usr/local/lib/python3.10/dist-packages/stevedore/named.py", line 156, in _load_one_plugin
    return super(NamedExtensionManager, self)._load_one_plugin(
  File "/usr/local/lib/python3.10/dist-packages/stevedore/extension.py", line 240, in _load_one_plugin
    plugin = ep.load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'magnum.policy'

same error with oslopolicy-sample-generator --namespace magnum

Reason:
 oslo.policy policy generator tool look for the service oslo policy enforcer entry and does not find it.
 setup.cfg file is missing the entry point for magnum oslo policy enforcer.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to magnum (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/magnum/+/921408

Changed in magnum:
status: New → In Progress
Changed in magnum:
assignee: nobody → Ghanshyam Mann (ghanshyammann)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnum (master)

Reviewed: https://review.opendev.org/c/openstack/magnum/+/921408
Committed: https://opendev.org/openstack/magnum/commit/8d09169a8aa4d8425e9ab7f37bbb636c4410a39f
Submitter: "Zuul (22348)"
Branch: master

commit 8d09169a8aa4d8425e9ab7f37bbb636c4410a39f
Author: Ghanshyam Mann <email address hidden>
Date: Wed Jun 5 11:32:54 2024 -0700

    Fix oslo policy file genrator tool for Magnum

    oslo tool to generate the policy or sample policy file does not work for magnum service.

    ``oslopolicy-policy-generator --namespace magnum`` end up with
    below error:
        ModuleNotFoundError: No module named 'magnum.policy'

    same error with oslopolicy-sample-generator --namespace magnum

    oslo.policy policy generator tool look for the service oslo policy enforcer
    entry and does not find it. setup.cfg file is missing the entry point for
    magnum oslo policy enforcer.

    - https://<email address hidden>/thread/5ZRWWL3YKWX3XCFGTC4G2KP6PCJMBL64/

    Closes-Bug: #2068519
    Change-Id: Iff94f7dea491b0ea465b17cd60c37423224f9ffa

Changed in magnum:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to magnum (stable/2024.1)

Fix proposed to branch: stable/2024.1
Review: https://review.opendev.org/c/openstack/magnum/+/921507

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to magnum (stable/2023.2)

Fix proposed to branch: stable/2023.2
Review: https://review.opendev.org/c/openstack/magnum/+/921508

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to magnum (stable/2023.1)

Fix proposed to branch: stable/2023.1
Review: https://review.opendev.org/c/openstack/magnum/+/921509

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnum (stable/2024.1)

Reviewed: https://review.opendev.org/c/openstack/magnum/+/921507
Committed: https://opendev.org/openstack/magnum/commit/2045ffb5ccbfb7873228eba9a6cecc1f65f4ab3f
Submitter: "Zuul (22348)"
Branch: stable/2024.1

commit 2045ffb5ccbfb7873228eba9a6cecc1f65f4ab3f
Author: Ghanshyam Mann <email address hidden>
Date: Wed Jun 5 11:32:54 2024 -0700

    Fix oslo policy file genrator tool for Magnum

    oslo tool to generate the policy or sample policy file does not work for magnum service.

    ``oslopolicy-policy-generator --namespace magnum`` end up with
    below error:
        ModuleNotFoundError: No module named 'magnum.policy'

    same error with oslopolicy-sample-generator --namespace magnum

    oslo.policy policy generator tool look for the service oslo policy enforcer
    entry and does not find it. setup.cfg file is missing the entry point for
    magnum oslo policy enforcer.

    - https://<email address hidden>/thread/5ZRWWL3YKWX3XCFGTC4G2KP6PCJMBL64/

    Closes-Bug: #2068519
    Change-Id: Iff94f7dea491b0ea465b17cd60c37423224f9ffa
    (cherry picked from commit 8d09169a8aa4d8425e9ab7f37bbb636c4410a39f)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnum (stable/2023.2)

Reviewed: https://review.opendev.org/c/openstack/magnum/+/921508
Committed: https://opendev.org/openstack/magnum/commit/f3cfcfd8f1d472950642e7103ab59853f5ee63da
Submitter: "Zuul (22348)"
Branch: stable/2023.2

commit f3cfcfd8f1d472950642e7103ab59853f5ee63da
Author: Ghanshyam Mann <email address hidden>
Date: Wed Jun 5 11:32:54 2024 -0700

    Fix oslo policy file genrator tool for Magnum

    oslo tool to generate the policy or sample policy file does not work for magnum service.

    ``oslopolicy-policy-generator --namespace magnum`` end up with
    below error:
        ModuleNotFoundError: No module named 'magnum.policy'

    same error with oslopolicy-sample-generator --namespace magnum

    oslo.policy policy generator tool look for the service oslo policy enforcer
    entry and does not find it. setup.cfg file is missing the entry point for
    magnum oslo policy enforcer.

    - https://<email address hidden>/thread/5ZRWWL3YKWX3XCFGTC4G2KP6PCJMBL64/

    Closes-Bug: #2068519
    Change-Id: Iff94f7dea491b0ea465b17cd60c37423224f9ffa
    (cherry picked from commit 8d09169a8aa4d8425e9ab7f37bbb636c4410a39f)
    (cherry picked from commit 2045ffb5ccbfb7873228eba9a6cecc1f65f4ab3f)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnum (stable/2023.1)

Reviewed: https://review.opendev.org/c/openstack/magnum/+/921509
Committed: https://opendev.org/openstack/magnum/commit/77293ee6c6543a7d058b6d17d7880fc36d665859
Submitter: "Zuul (22348)"
Branch: stable/2023.1

commit 77293ee6c6543a7d058b6d17d7880fc36d665859
Author: Ghanshyam Mann <email address hidden>
Date: Wed Jun 5 11:32:54 2024 -0700

    Fix oslo policy file genrator tool for Magnum

    oslo tool to generate the policy or sample policy file does not work for magnum service.

    ``oslopolicy-policy-generator --namespace magnum`` end up with
    below error:
        ModuleNotFoundError: No module named 'magnum.policy'

    same error with oslopolicy-sample-generator --namespace magnum

    oslo.policy policy generator tool look for the service oslo policy enforcer
    entry and does not find it. setup.cfg file is missing the entry point for
    magnum oslo policy enforcer.

    - https://<email address hidden>/thread/5ZRWWL3YKWX3XCFGTC4G2KP6PCJMBL64/

    Closes-Bug: #2068519
    Change-Id: Iff94f7dea491b0ea465b17cd60c37423224f9ffa
    (cherry picked from commit 8d09169a8aa4d8425e9ab7f37bbb636c4410a39f)
    (cherry picked from commit 2045ffb5ccbfb7873228eba9a6cecc1f65f4ab3f)
    (cherry picked from commit f3cfcfd8f1d472950642e7103ab59853f5ee63da)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.