Comment 10 for bug 1843931

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.policy (stable/train)

Reviewed: https://review.opendev.org/694841
Committed: https://git.openstack.org/cgit/openstack/oslo.policy/commit/?id=3898da6d8c54229aa60c0e3571c7ec0f847ca8ea
Submitter: Zuul
Branch: stable/train

commit 3898da6d8c54229aa60c0e3571c7ec0f847ca8ea
Author: Ben Nemec <email address hidden>
Date: Fri Sep 13 20:04:56 2019 +0000

    Fix reference cycle caused by deprecated sample override

    In the sample policy generator, we create a rule that maps the
    deprecated name of a policy to the new rule name. For example:

    identity:old_rule: rule:identity:new_rule

    However, in the policy code, if we see an override of a deprecated
    name and no override for the new name, we apply the value of the
    deprecated name to the new name. In the above case, this results
    in us creating a rule that looks like:

    identity:new_rule: rule:identity:new_rule

    which is a circular reference and nonsense.

    To fix this, I added a check to the deprecated rule logic that looks
    for instances where the old override is just a reference to the new
    rule. If that's the case, then we don't need to do anything because
    it's already doing the right thing.

    Change-Id: Ifd14993bc84e83c13abab3456fbf670c06e5806f
    Closes-Bug: 1843931
    (cherry picked from commit 82a2c8d8b71896b1f8b7f33c560681367ae76755)