Deprecation Warnings for tenant_id in Policy File

Bug #1976219 reported by Hiromu Asahina
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
Fix Released
Low
Unassigned

Bug Description

The following warnings are emitted many times during unittest.

/opt/stack/tacker/.tox/py39/lib/python3.9/site-packages/oslo_context/context.py:100: DeprecationWarning: Policy enforcement is depending on the value of tenant_id. This key is deprecated. Please update your policy file to use the standard policy values.

This happens because oslo.context emits a warning for attirbutes that is not listed in [1].
According to the above warning message, policy file should be modified to use $(project_id)s instead of $(tenant_id)s.

[1] https://github.com/openstack/oslo.context/blob/master/oslo_context/context.py#L313-L327

summary: - Deprecation Warnings
+ Deprecation Warnings for tenant_id
summary: - Deprecation Warnings for tenant_id
+ Deprecation Warnings for tenant_id in Policy FIle
summary: - Deprecation Warnings for tenant_id in Policy FIle
+ Deprecation Warnings for tenant_id in Policy File
description: updated
Changed in tacker:
status: New → In Progress
Yasufumi Ogawa (yasufum)
Changed in tacker:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tacker (master)

Reviewed: https://review.opendev.org/c/openstack/tacker/+/842903
Committed: https://opendev.org/openstack/tacker/commit/39925d1141be6e58a318256c2e5cd42cc417c8f4
Submitter: "Zuul (22348)"
Branch: master

commit 39925d1141be6e58a318256c2e5cd42cc417c8f4
Author: Hiromu Asahina <email address hidden>
Date: Mon May 23 02:50:42 2022 +0900

    Remove deprecated attributes from context

    The oslo.context emits a warning for attributes that are not listed in
    [1] and considered to be deprecated. According to the warning message,
    the policy file should be modified to use $(project_id)s instead of
    $(tenant_id)s. Also, context.user is deprecated. We should remove lines
    using context.user and use context.user_id only.

    The following deprecation warnings are gone with the patch:

    - context.py:100: DeprecationWarning: Policy enforcement is depending on
      the value of tenant_id. This key is deprecated. Please update your
      policy file to use the standard policy values.

    - test_auth.py:75: DeprecationWarning: Property ‘user’ has moved to
      ‘user_id’ in version ‘2.6’ and will be removed in version ‘3.0’

    [1] https://github.com/openstack/oslo.context/blob/master/oslo_context/context.py#L313-L327

    Change-Id: Ib06cd0d54772d17838789943b6a09c581b899435
    Closes-Bug: #1976219

Changed in tacker:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tacker (stable/yoga)

Fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/tacker/+/848564

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tacker (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/tacker/+/848564
Committed: https://opendev.org/openstack/tacker/commit/2625c00375bb0ae407ecfb8ac60f80d6b10f5305
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit 2625c00375bb0ae407ecfb8ac60f80d6b10f5305
Author: Hiromu Asahina <email address hidden>
Date: Mon May 23 02:50:42 2022 +0900

    Remove deprecated attributes from context

    The oslo.context emits a warning for attributes that are not listed in
    [1] and considered to be deprecated. According to the warning message,
    the policy file should be modified to use $(project_id)s instead of
    $(tenant_id)s. Also, context.user is deprecated. We should remove lines
    using context.user and use context.user_id only.

    The following deprecation warnings are gone with the patch:

    - context.py:100: DeprecationWarning: Policy enforcement is depending on
      the value of tenant_id. This key is deprecated. Please update your
      policy file to use the standard policy values.

    - test_auth.py:75: DeprecationWarning: Property ‘user’ has moved to
      ‘user_id’ in version ‘2.6’ and will be removed in version ‘3.0’

    [1] https://github.com/openstack/oslo.context/blob/master/oslo_context/context.py#L313-L327

    Change-Id: Ib06cd0d54772d17838789943b6a09c581b899435
    Closes-Bug: #1976219
    (cherry picked from commit 39925d1141be6e58a318256c2e5cd42cc417c8f4)

tags: added: in-stable-yoga
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tacker 8.0.0.0rc1

This issue was fixed in the openstack/tacker 8.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tacker 7.1.0

This issue was fixed in the openstack/tacker 7.1.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.