From 4fd8e624da077199d671ce3f01f03dbb6c900591 Mon Sep 17 00:00:00 2001 From: Matthew Harmsen Date: Dec 16 2015 22:37:47 +0000 Subject: Fix pylint errors on F24. --- diff --git a/pki-core-Fix-pylint-errors-on-F24.patch b/pki-core-Fix-pylint-errors-on-F24.patch new file mode 100644 index 0000000..834cc83 --- /dev/null +++ b/pki-core-Fix-pylint-errors-on-F24.patch @@ -0,0 +1,69 @@ +From b18e9c1aec5860dd4cf10986e250e47ec6cb7b5b Mon Sep 17 00:00:00 2001 +From: Matthew Harmsen +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 + diff --git a/pki-core.spec b/pki-core.spec index c0ad37c..3114bcb 100644 --- a/pki-core.spec +++ b/pki-core.spec @@ -107,9 +107,6 @@ BuildRequires: pylint BuildRequires: python-nss BuildRequires: python-requests -%if 0%{?fedora} >= 23 -BuildRequires: python-six -%endif BuildRequires: libselinux-python BuildRequires: policycoreutils-python %if 0%{?fedora} >= 23 @@ -207,6 +204,9 @@ Patch39: pki-core-Replaced-legacy-HttpClient.patch Patch40: pki-core-Added-automatic-Tomcat-migration.patch ## pki-core-10.2.6-13 Patch41: pki-core-sslget-must-set-host-HTTP-header.patch +%if 0%{?fedora} >= 24 +Patch42: pki-core-Fix-pylint-errors-on-F24.patch +%endif %global saveFileContext() \ if [ -s /etc/selinux/config ]; then \ @@ -753,6 +753,9 @@ This package is a part of the PKI Core used by the Certificate System. %patch39 -p1 %patch40 -p1 %patch41 -p1 +%if 0%{?fedora} >= 24 +%patch42 -p1 +%endif %clean %{__rm} -rf %{buildroot}