Allow policy file to not exist

Bug #1603329 reported by Kseniya Tychkova
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.policy
Fix Released
Undecided
Unassigned

Bug Description

Now that policy rules can be registered in code there is a desire to run
projects without a policy file. However oslo.policy assumed a policy
file would exist and would raise an error if it could not be found.
oslo.policy should have a "no file" mode.

Changed in oslo.policy:
assignee: nobody → Kseniya Tychkova (ktychkova)
Changed in oslo.policy:
status: New → Confirmed
Revision history for this message
aeva black (tenbrae) wrote :

Having just tripped over this, I think it's also a documentation bug, because the API docs do not indicate that policy_file is required when setting up the Enforcer, and the class can be instantiated while explicitly passing in a value of 'None' (eg, because that is how a project is configured). A configuration error is then later thrown from within the enforce() method.

http://docs.openstack.org/developer/oslo.policy/api/oslo_policy.html#oslo_policy.policy.Enforcer

class oslo_policy.policy.Enforcer(conf, policy_file=None, rules=None, default_rule=None, use_conf=True, overwrite=True)

policy_file – Custom policy file to use, if none is specified, conf.oslo_policy.policy_file will be used.

Revision history for this message
Kseniya Tychkova (ktychkova) wrote :
Revision history for this message
Lance Bragstad (lbragstad) wrote :

I think the fix for this merged already [0]. While the refactor is still something we can do, I think we can close out this bug and release a new version of oslo.policy with it later.

[0] https://review.openstack.org/#/c/341732/

Changed in oslo.policy:
status: Confirmed → Fix Committed
assignee: Kseniya Tychkova (ktychkova) → nobody
Revision history for this message
Lance Bragstad (lbragstad) wrote :
Changed in oslo.policy:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on oslo.policy (master)

Change abandoned by Colleen Murphy (<email address hidden>) on branch: master
Review: https://review.openstack.org/346002
Reason: This bug was closed as fixed and this patch hasn't had any activity in almost three years. I'm going to administratively abandon it, feel free to restore or reach out if you think this should be revisited.

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.