Fall back to old rules when removing "redundant" rule

Bug #1962602 reported by Arne Wiebalck
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.policy
New
Undecided
Unassigned

Bug Description

Ironic on Wallaby:

With new defaults enabled, /var/log/httpd/ironic_wsgi_error.log logs:

(1)
[wsgi:error] [pid 1546286:tid 140232596891392] [remote x:52214] /usr/lib/python3.6/site-packages/oslo_policy/policy.py:736: UserWarning: Policy "baremetal:volume:get":"rule:is_admin or rule:is_observer" was deprecated in W in favor of "baremetal:volume:list":"role:reader". Reason:
[wsgi:error] [pid 1546286:tid 140232596891392] [remote x:52214] The baremetal volume API is now aware of system scope and default
[wsgi:error] [pid 1546286:tid 140232596891392] [remote x:52214] roles.
[wsgi:error] [pid 1546286:tid 140232596891392] [remote x:52214] . Either ensure your deployment is ready for the new default or copy/paste the deprecated policy into your policy file and maintain it manually.
[wsgi:error] [pid 1546286:tid 140232596891392] [remote x:52214] warnings.warn(deprecated_msg)

This seems to be the old default, though, as the new default is

"baremetal:volume:list": "role:reader"

And indeed, adding the new rule to the policy file, /var/log/ironic/ironic-api.log logs

(2)
WARNING oslo_policy.policy [req-a4a8d6bf-c987-4f6d-b31d-eda7574327c6 svcbare d6e0d64a-031f-4a77-b66f-7b683cf10c0e - default default] Policy Rules ['baremetal:volume:list'] specified in policy files are the same as the defaults provided by the service. You can remove these rules from policy files which will make maintenance easier. You can detect these redundant rules by ``oslopolicy-list-redundant`` tool also.

Removing it, brings us back to (1).

TL;DR: It seems the old defaults are evaluated in certain conditions, although they are neither on the policy file and the config says to use the new defaults.

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.