Unnecessary deepcopy in debug logging

Bug #1886984 reported by Ben Nemec
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.policy
Fix Released
Medium
Ben Nemec

Bug Description

There are a couple of deepcopies (for example [0]) in the debug logging code for policy that is unnecessary, and introduces the possibility of failure if an object that is not deepcopy-able is used while debug logging is enabled. This is particularly bad since it means that just enabling debug logging may change the behavior of oslo.policy.

Changed in oslo.policy:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.policy (master)

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

commit 65b96ab006f8ab8183afd509823110345460e149
Author: Ben Nemec <email address hidden>
Date: Wed Jul 8 16:55:10 2020 +0000

    Don't deepcopy objects before mask_dict_password

    As far as I can tell, mask_dict_password does not modify the object
    passed in to it[0]. As such, this deepcopy only adds an unnecessary
    requirement on the policy objects that makes it possible for a call
    to fail in a different way when debug logging is enabled. Since this
    is pretty terrible, let's get rid of it.

    Change-Id: I34eace9806e6ed7c9c6206a34f55debc0c20bac6
    Closes-Bug: 1886984
    0: https://github.com/openstack/oslo.utils/blob/4fe75b7e1bd3144282f107ce7cb61880257c7c1e/oslo_utils/strutils.py#L349

Changed in oslo.policy:
status: In Progress → Fix Released
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.