deprecated_for_removal generated sample policy has uncommented rule entry
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.policy |
Fix Released
|
Undecided
|
Lance Bragstad |
Bug Description
I have code like this:
https:/
rules = [
# "placement" is the default rule (action) used for all routes that do
# not yet have granular policy rules. It is used in
# PlacementHandle
# granular policy handling.
policy.
# TODO(mriedem): Figure out how to use deprecated_rule to alias
# this for rule:admin_api since it's basically a rename.
policy.
]
def list_rules():
return rules
--
The sample policy file generated from this has the deprecated_
# DEPRECATED
# "placement" has been deprecated since 18.0.0.
# This was a catch-all rule hard-coded into the placement service and
# has been superseded by granular policy rules per operation.
# This rule is used for all routes that do not yet have granular
# policy rules. It will be replaced with rule:admin_api.
#"placement": "role:admin"
"placement": "role:admin"# Default rule for most placement APIs.
#"admin_api": "role:admin"
It seems there is a missing # to comment out the %(text)s line here:
https:/
This clearly looks wrong and there is at least a missing newline.
Changed in oslo.policy: | |
status: | New → Confirmed |
I believe since the rule is deprecated for removal in the future, the entry should not be commented out.
If the rule is already deprecated, you should use the class DeprecatedRule and not RuleDefault.
On the other hand, it does look like it's missing a newline.