adamwill / rpms / openscap

Forked from rpms/openscap 3 years ago
Clone

Blame SOURCES/openscap-1.2.10-oscap-docker-urllib.patch

0746d7
From fea6c0359ff145c723f3d8df3f2e1496bc797f41 Mon Sep 17 00:00:00 2001
0746d7
From: Martin Preisler <mpreisle@redhat.com>
0746d7
Date: Fri, 29 Jul 2016 14:42:36 -0400
0746d7
Subject: [PATCH] Use build_opener() in get_cve_input.py, it's simpler and
0746d7
 honors proxy settings
0746d7
0746d7
See https://bugzilla.redhat.com/show_bug.cgi?id=1351952
0746d7
---
0746d7
 utils/oscap_docker_python/get_cve_input.py | 9 ++-------
0746d7
 1 file changed, 2 insertions(+), 7 deletions(-)
0746d7
0746d7
diff --git a/utils/oscap_docker_python/get_cve_input.py b/utils/oscap_docker_python/get_cve_input.py
0746d7
index 8d72bd0..1b55f03 100644
0746d7
--- a/utils/oscap_docker_python/get_cve_input.py
0746d7
+++ b/utils/oscap_docker_python/get_cve_input.py
0746d7
@@ -113,13 +113,8 @@ class getInputCVE(object):
0746d7
             if self.DEBUG:
0746d7
                 stderr.write("No file in cache, fetching {0}\n".format(dest_file))
0746d7
             return False
0746d7
-        opener = urllib.OpenerDirector()
0746d7
-        opener.add_handler(urllib.HTTPHandler())
0746d7
-        opener.add_handler(urllib.HTTPSHandler())
0746d7
-        opener.add_handler(urllib.HTTPDefaultErrorHandler())
0746d7
-        # Extra for handling redirects
0746d7
-        opener.add_handler(urllib.HTTPErrorProcessor())
0746d7
-        opener.add_handler(urllib.HTTPRedirectHandler())
0746d7
+
0746d7
+        opener = urllib.build_opener()
0746d7
         # Add the header
0746d7
         opener.addheaders = self.hdr2
0746d7
         # Grab the header
0746d7
-- 
0746d7
2.7.4
0746d7