diff options
author | Matthew Harmsen <mharmsen@redhat.com> | 2015-05-26 19:28:09 -0600 |
---|---|---|
committer | Matthew Harmsen <mharmsen@redhat.com> | 2015-05-26 19:48:14 -0600 |
commit | c695c2abf0a2edb4878c1cf01fd3222821ae8fc9 (patch) | |
tree | 1c602dbe54dc539fef858ea586bad5d86ae2a439 | |
parent | 576ab24f0d2499465904c3770ef5cffdfa6ec8a2 (diff) | |
download | pki-c695c2abf0a2edb4878c1cf01fd3222821ae8fc9.tar.gz pki-c695c2abf0a2edb4878c1cf01fd3222821ae8fc9.tar.xz pki-c695c2abf0a2edb4878c1cf01fd3222821ae8fc9.zip |
PKI TRAC Ticket #1388 - pylint unidiomatic-typecheck warnings cause koji builds to fail
(cherry picked from commit d2c24aff4e9dc6aa27b337479cfee1fac4940994)
-rw-r--r-- | base/common/python/pki/encoder.py | 5 | ||||
-rw-r--r-- | base/common/python/pki/system.py | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/base/common/python/pki/encoder.py b/base/common/python/pki/encoder.py index 7b621f290..1af0feaad 100644 --- a/base/common/python/pki/encoder.py +++ b/base/common/python/pki/encoder.py @@ -36,8 +36,9 @@ class CustomTypeEncoder(json.JSONEncoder): for k, v in TYPES.items(): if isinstance(obj, v): return {k: obj.__dict__} - if type(obj) in NOTYPES.itervalues(): - return self.attr_name_conversion(obj.__dict__, type(obj)) + for t in NOTYPES.itervalues(): + if isinstance(obj, t): + return self.attr_name_conversion(obj.__dict__, type(obj)) return json.JSONEncoder.default(self, obj) @staticmethod diff --git a/base/common/python/pki/system.py b/base/common/python/pki/system.py index 24deefca4..76b505909 100644 --- a/base/common/python/pki/system.py +++ b/base/common/python/pki/system.py @@ -111,7 +111,7 @@ class SecurityDomainSubsystem(object): subsystem.name = json_value['@id'] hosts = json_value['Host'] - if type(hosts) is dict: + if isinstance(hosts, dict): hosts = [ hosts ] for h in hosts: @@ -154,7 +154,7 @@ class SecurityDomainInfo(object): security_domain.name = domain_info['@id'] subsystems = domain_info['Subsystem'] - if type(subsystems) is dict: + if isinstance(subsystems, dict): subsystems = [ subsystems ] for s in subsystems: |