summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Harlow <jxharlow@godaddy.com>2018-07-19 12:17:42 -0700
committerJoshua Harlow <jxharlow@godaddy.com>2018-07-19 12:19:14 -0700
commit25ed5ceb582ba670bd49bdd6359b740b6cb396d1 (patch)
tree30f2275c108e49ce92bb8fea1d0fbce7293a0138
parent7f8397091f63488f314f4dea49d83d6947f9fc27 (diff)
downloadoslo-utils-25ed5ceb582ba670bd49bdd6359b740b6cb396d1.tar.gz
Remove extra copy.deepcopy
This method is called recursively (ie deeply) by default so there doesn't seem to be a good reason to deepcopy over and over and over at every recusion level especially since a new output dictionary is getting created anyway. Change-Id: I644ef881e487c06dc4db77d60cfe765b0e59b547
-rw-r--r--oslo_utils/strutils.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/oslo_utils/strutils.py b/oslo_utils/strutils.py
index 922ad22..ebcc104 100644
--- a/oslo_utils/strutils.py
+++ b/oslo_utils/strutils.py
@@ -17,7 +17,6 @@
System-level utilities and helper functions.
"""
-import copy
import math
import re
import unicodedata
@@ -394,9 +393,7 @@ def mask_dict_password(dictionary, secret="***"): # nosec
if not isinstance(dictionary, dict):
raise TypeError("Expected a dictionary, got %s instead."
% type(dictionary))
-
- out = copy.deepcopy(dictionary)
-
+ out = {}
for k, v in dictionary.items():
if isinstance(v, dict):
out[k] = mask_dict_password(v, secret=secret)