Blob Blame History Raw
From b18e9c1aec5860dd4cf10986e250e47ec6cb7b5b Mon Sep 17 00:00:00 2001
From: Matthew Harmsen <mharmsen@pki.usersys.redhat.com>
Date: Wed, 16 Dec 2015 12:24:55 -0700
Subject: [PATCH] Fix pylint errors on F24.

---
 base/common/python/pki/cert.py                        | 3 ++-
 base/common/python/pki/systemcert.py                  | 6 ++++--
 base/server/python/pki/server/deployment/pkihelper.py | 5 +++--
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/base/common/python/pki/cert.py b/base/common/python/pki/cert.py
index 01d2a61..23179af 100644
--- a/base/common/python/pki/cert.py
+++ b/base/common/python/pki/cert.py
@@ -585,6 +585,7 @@ class CertReviewResponse(CertEnrollmentRequest):
         else:
             self.policy_sets = policy_sets
 
+    # pylint: disable=E1101
     @classmethod
     def from_json(cls, attr_list):
 
@@ -1202,4 +1203,4 @@ def main():
 
 
 if __name__ == "__main__":
-    main()
\ No newline at end of file
+    main()
diff --git a/base/common/python/pki/systemcert.py b/base/common/python/pki/systemcert.py
index d59e07b..6ca9097 100644
--- a/base/common/python/pki/systemcert.py
+++ b/base/common/python/pki/systemcert.py
@@ -52,8 +52,10 @@ class SystemCertClient(object):
         response = self.connection.get(url, self.headers)
         cert_data = CertData.from_json(response.json())
 
+        # pylint: disable=E1136
         pem = cert_data.encoded
-        b64 = pem[len(pki.CERT_HEADER):len(pem) - len(pki.CERT_FOOTER)]
-        cert_data.binary = base64.decodestring(b64)
+        if pem is not None:
+            b64 = pem[len(pki.CERT_HEADER):len(pem) - len(pki.CERT_FOOTER)]
+            cert_data.binary = base64.decodestring(b64)
 
         return cert_data
diff --git a/base/server/python/pki/server/deployment/pkihelper.py b/base/server/python/pki/server/deployment/pkihelper.py
index b6ee61b..2b2aabf 100644
--- a/base/server/python/pki/server/deployment/pkihelper.py
+++ b/base/server/python/pki/server/deployment/pkihelper.py
@@ -3868,11 +3868,12 @@ class ConfigClient:
                 extra=config.PKI_INDENTATION_LEVEL_2)
 
             if hasattr(e, 'response'):
+                text = e.response.text  # pylint: disable=E1101
                 try:
-                    root = ET.fromstring(e.response.text)
+                    root = ET.fromstring(text)
                 except ET.ParseError, pe:
                     config.pki_log.error(
-                        "ParseError: %s: %s " % (pe, e.response.text),
+                        "ParseError: %s: %s " % (pe, text),
                         extra=config.PKI_INDENTATION_LEVEL_2)
                     raise
 
-- 
2.5.0