Deprecating a policy is confusing
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.policy |
Confirmed
|
Medium
|
Unassigned |
Bug Description
Some oddities came up in IRC today as we were using DeprecatedRule to cover a test case in keystone [0].
The initial implementation of the DeprecatedRule object attempted to follow existing conventions used to deprecate configuration options in oslo.config, but there are some ways the we could improve the experience.
It can be confusing to see deprecated kwargs on the option that is not actually being deprecated. One way we could fix this would be to isolate all deprecated kwargs to the DeprecatedRule object instead of having to deal with setting deprecated kwargs on each object. So something like the following would be preferred:
deprecated_rule = policy.
name='foo:bar',
check_
deprecated_
deprecated_
)
policy.
name=
check_
description
operations=
deprecated_
)
instead of:
deprecated_rule = policy.
name='foo:bar',
check_
)
policy.
name=
check_
description
operations=
deprecated_
deprecated_
deprecated_
)
summary: |
- Deprecated rule is confusing + Deprecating a policy is confusing |
Changed in oslo.policy: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
I have a feeling even if we fix this bug, we'll have to support both ways of deprecating a policy for backwards compatibility. But we could just advertise the preferred way to deprecate in our documentation.