summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-04-20 23:31:29 +0000
committerGerrit Code Review <review@openstack.org>2020-04-20 23:31:29 +0000
commit0eac6f16b1fc70fcd1b79fae5cff2388e2b9f8af (patch)
tree9f2fa969350a7890cd0237d09b06ed03afe80aac
parent4692841b4166f5e232882259a4caffefa8a9613a (diff)
parenta846278b6dc2c6074713f43cc7cc0e2ea7ab3b6b (diff)
downloadoslo-policy-0eac6f16b1fc70fcd1b79fae5cff2388e2b9f8af.tar.gz
Merge "Remove the conversion according to the comment of jdennis"
-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 fd7fbf3..406ed35 100644
--- a/oslo_policy/policy.py
+++ b/oslo_policy/policy.py
@@ -889,20 +889,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: