From 519a1911eabb4f37ed114edfa8e4f6925c0bc004 Mon Sep 17 00:00:00 2001 From: Akita Noek Date: Wed, 24 Feb 2016 18:02:20 -0500 Subject: [PATCH] Use better isinstance(x) type checking --- awx/plugins/callback/job_event_callback.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/plugins/callback/job_event_callback.py b/awx/plugins/callback/job_event_callback.py index be747bc755..eb2f3e9d6e 100644 --- a/awx/plugins/callback/job_event_callback.py +++ b/awx/plugins/callback/job_event_callback.py @@ -67,7 +67,7 @@ CENSOR_FIELD_WHITELIST=[ ] def censor(obj, no_log=False): - if type(obj) is not dict: + if not isinstance(obj, dict): if no_log: return "the output has been hidden due to the fact that 'no_log: true' was specified for this result" return obj @@ -84,7 +84,7 @@ def censor(obj, no_log=False): new_obj['censored'] = "the output has been hidden due to the fact that 'no_log: true' was specified for this result" obj = new_obj if 'results' in obj: - if type(obj['results']) is list: + if isinstance(obj['results'], list): for i in xrange(len(obj['results'])): obj['results'][i] = censor(obj['results'][i], obj.get('_ansible_no_log', no_log)) elif obj.get('_ansible_no_log', False):