Allow policy file to not exist
Bug #1603329 reported by
Kseniya Tychkova
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 |
To post a comment you must log in.
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.