Unnecessary deepcopy in debug logging
Bug #1886984 reported by
Ben Nemec
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 |
To post a comment you must log in.
Reviewed: https:/ /review. opendev. org/740068 /git.openstack. org/cgit/ openstack/ oslo.policy/ commit/ ?id=65b96ab006f 8ab8183afd50982 3110345460e149
Committed: https:/
Submitter: Zuul
Branch: master
commit 65b96ab006f8ab8 183afd509823110 345460e149
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: I34eace9806e6ed 7c9c6206a34f55d ebc0c20bac6 /github. com/openstack/ oslo.utils/ blob/4fe75b7e1b d3144282f107ce7 cb61880257c7c1e /oslo_utils/ strutils. py#L349
Closes-Bug: 1886984
0: https:/