Bug 1463916
| Summary: | Platform Dependent Python Import | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Matthew Harmsen <mharmsen> | |
| Component: | pki-core | Assignee: | Christian Heimes <cheimes> | |
| Status: | CLOSED ERRATA | QA Contact: | Asha Akkiangady <aakkiang> | |
| Severity: | urgent | Docs Contact: | ||
| Priority: | urgent | |||
| Version: | 7.4 | CC: | cheimes, msauton, pbokoc, ssidhaye | |
| Target Milestone: | rc | Keywords: | ZStream | |
| Target Release: | --- | |||
| Hardware: | All | |||
| OS: | Linux | |||
| Whiteboard: | ||||
| Fixed In Version: | Doc Type: | No Doc Update | ||
| Doc Text: |
undefined
|
Story Points: | --- | |
| Clone Of: | ||||
| : | 1472619 (view as bug list) | Environment: | ||
| Last Closed: | 2018-04-10 16:58:29 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Embargoed: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 1472619 | |||
|
Description
Matthew Harmsen
2017-06-22 06:12:30 UTC
To correct this issue, I suggest the following changes:
diff --git a/base/common/python/pki/client.py b/base/common/python/pki/client.py
index 805d0fa..21e0811 100644
--- a/base/common/python/pki/client.py
+++ b/base/common/python/pki/client.py
@@ -25,7 +25,7 @@ import functools
import warnings
import requests
-from requests.packages.urllib3.exceptions import InsecureRequestWarning
+from urllib3.exceptions import InsecureRequestWarning
Additionally, build and runtime requirements for "python-urllib3" (Python 2) and"python3-urllib3" (Python 3) should be added appropriately to the "pki-core.spec" file.
Python requests just to ship urllib3 and other dependencies as vendored sub-packages in requests.packages.*. Most recently these packages were unbundled.
requests.packages.urllib3 and urllib3 are two different packages and the exception classes are not identical objects. To be compatible with both the vendored and unvendored versions, please do:
try:
from requests.packages.urllib3.exceptions import InsecureRequestWarning
except ImportError:
from urllib3.exceptions import InsecureRequestWarning
commit 9d63a7a6b1abb42595b6a24296a39a79441ba8df
Author: Matthew Harmsen <mharmsen>
Date: Thu Jun 22 12:50:21 2017 -0600
dogtagpki Pagure Issue #2745 - Platform Dependent Python Import
Build used for verification: [root@pki1 yum.repos.d]# rpm -qi pki-base Name : pki-base Version : 10.5.1 Release : 4.el7 Architecture: noarch Install Date: Thursday 07 December 2017 09:56:36 AM IST Group : System Environment/Base Size : 2096050 License : GPLv2 Signature : RSA/SHA256, Wednesday 29 November 2017 09:03:08 AM IST, Key ID 199e2f91fd431d51 Source RPM : pki-core-10.5.1-4.el7.src.rpm Build Date : Wednesday 29 November 2017 07:47:20 AM IST Build Host : ppc-035.build.eng.bos.redhat.com Relocations : (not relocatable) Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla> Vendor : Red Hat, Inc. URL : http://pki.fedoraproject.org/ Summary : Certificate System - PKI Framework /usr/lib/python2.7/site-packages/pki/client.py contents import requests try: from requests.packages.urllib3.exceptions import InsecureRequestWarning except ImportError: from urllib3.exceptions import InsecureRequestWarning Verified that pki commands are not affected by this change. Marking this bug verified. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:0925 |