Comment 2 for bug 1965315

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

Reviewed: https://review.opendev.org/c/openstack/oslo.policy/+/834222
Committed: https://opendev.org/openstack/oslo.policy/commit/9bc1783400f9960b7132bf631c690a98fbfc8066
Submitter: "Zuul (22348)"
Branch: master

commit 9bc1783400f9960b7132bf631c690a98fbfc8066
Author: Slawek Kaplonski <email address hidden>
Date: Thu Mar 17 20:35:45 2022 +0100

    Don't raise InvalidScope exception when do_raise=False

    In the Enforcer.enforce() method there is boolean parameter do_raise.
    When it is set to False, enforce() method should return True/False as an
    enforcement result and not raise exception. It works like that with
    PolicyNotAuthorized exception but since some time this method can also
    raise InvalidScope exception and in such case behaviour was different.

    This patch changes that behaviour so InvalidScope exception will also
    not be raised when do_raise=False.

    Closes-bug: #1965315
    Change-Id: I37fd682ffa9d6f4c69698e1be42adac28bbfe72a