[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Pki-devel] Fix for pylint issue



Please review the attached patch which addresses the following ticket:


From 308e00c4e7f1719a4475b76b184b36cddb77140b Mon Sep 17 00:00:00 2001
From: Matthew Harmsen <mharmsen pki usersys redhat com>
Date: Tue, 26 May 2015 19:04:16 -0600
Subject: [PATCH] PKI TRAC Ticket #1388 - pylint unidiomatic-typecheck warnings
 cause koji builds to fail

---
 base/common/python/pki/encoder.py | 2 +-
 base/common/python/pki/system.py  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/base/common/python/pki/encoder.py b/base/common/python/pki/encoder.py
index 7b621f2..9a2502f 100644
--- a/base/common/python/pki/encoder.py
+++ b/base/common/python/pki/encoder.py
@@ -36,7 +36,7 @@ class CustomTypeEncoder(json.JSONEncoder):
         for k, v in TYPES.items():
             if isinstance(obj, v):
                 return {k: obj.__dict__}
-        if type(obj) in NOTYPES.itervalues():
+        if isinstance(obj) in NOTYPES.itervalues():
             return self.attr_name_conversion(obj.__dict__, type(obj))
         return json.JSONEncoder.default(self, obj)
 
diff --git a/base/common/python/pki/system.py b/base/common/python/pki/system.py
index 24deefc..21a44e1 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) is 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) is dict:
                 subsystems = [ subsystems ]
 
         for s in subsystems:
-- 
2.1.0


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]