Comment 2 for bug 1863637

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

Reviewed: https://review.opendev.org/708212
Committed: https://git.openstack.org/cgit/openstack/oslo.policy/commit/?id=c3868371212597069e4614d9ae05fe7cd0358ca1
Submitter: Zuul
Branch: master

commit c3868371212597069e4614d9ae05fe7cd0358ca1
Author: Ben Nemec <email address hidden>
Date: Mon Feb 17 16:17:34 2020 +0000

    Temporarily make namespace arg optional

    In order to fix the referenced bug, we need to register cli args on
    the global config object. Unfortunately, that causes issues because
    our consumers are re-calling the conf object in their enforcers due
    to the way we used to handle cli args. Specifically, the conf call
    in the consumer fails because the namespace arg from oslo.policy is
    registered as required, but they don't pass it to the conf call.

    Long-term we want to stop having consumers call the conf object at
    all, but in the meantime we need to provide a migration path that
    doesn't break them. This change registers the namespace arg as
    optional on the conf object and temporarily moves the required check
    to oslo.policy. This will allow us to maintain the existing behavior
    for our cli tools while not breaking consumers who haven't migrated
    to the new cli arg behavior.

    Note that we do have unit test coverage of this behavior[0], so we
    can be reasonably confident the explicit check is maintaining
    compatibility.

    Change-Id: I34ce1dd15c464bec319e51d3e217e26554f1a944
    Closes-Bug: 1863637
    Related-Bug: 1849518
    0: https://github.com/openstack/oslo.policy/blob/6e2fe3857367eb2b3e2d2e92121a408e1ff89ea4/oslo_policy/tests/test_generator.py#L500