summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Dayne <huyueheng@inspur.com>2020-04-03 14:42:39 +0800
committerArthur Dayne <huyueheng@inspur.com>2020-04-07 08:24:19 +0000
commita846278b6dc2c6074713f43cc7cc0e2ea7ab3b6b (patch)
treefd8d7dbd879cd96c0295f85b2eb2c697c6545f25
parent8ce161986a4063fa28774fd78c13b777ed3e2004 (diff)
downloadoslo-policy-a846278b6dc2c6074713f43cc7cc0e2ea7ab3b6b.tar.gz
Remove the conversion according to the comment of jdennis
Because the bug #1804528 has been fixed, the conversion to dict can be removed. Change-Id: Ibec9ec21096977c2876b373e388647766c79b3a7
-rw-r--r--oslo_policy/policy.py15
1 files changed, 1 insertions, 14 deletions
diff --git a/oslo_policy/policy.py b/oslo_policy/policy.py
index 61a3597..c1dca53 100644
--- a/oslo_policy/policy.py
+++ b/oslo_policy/policy.py
@@ -878,20 +878,7 @@ class Enforcer(object):
if LOG.isEnabledFor(logging.DEBUG):
try:
- # NOTE(jdennis) Although a MutableMapping behaves like
- # a dict oslo.strutils.mask_dict_password() requires a
- # dict. Bug #1804528 was opened to fix this, once that
- # bug is fixed the conversion to dict can be removed.
- if isinstance(creds, dict):
- creds_dict = creds
- elif isinstance(creds, collections.MutableMapping):
- creds_dict = dict(creds)
- else:
- raise TypeError('unexpected type %(creds_type)s' %
- {'creds_type': type(creds)})
- creds_dict = strutils.mask_dict_password(
- copy.deepcopy(creds_dict)
- )
+ creds_dict = strutils.mask_dict_password(copy.deepcopy(creds))
creds_msg = jsonutils.dumps(creds_dict,
skipkeys=True, sort_keys=True)
except Exception as e: