adamwill / rpms / openscap

Forked from rpms/openscap 3 years ago
Clone
Blob Blame History Raw
From fea6c0359ff145c723f3d8df3f2e1496bc797f41 Mon Sep 17 00:00:00 2001
From: Martin Preisler <mpreisle@redhat.com>
Date: Fri, 29 Jul 2016 14:42:36 -0400
Subject: [PATCH] Use build_opener() in get_cve_input.py, it's simpler and
 honors proxy settings

See https://bugzilla.redhat.com/show_bug.cgi?id=1351952
---
 utils/oscap_docker_python/get_cve_input.py | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/utils/oscap_docker_python/get_cve_input.py b/utils/oscap_docker_python/get_cve_input.py
index 8d72bd0..1b55f03 100644
--- a/utils/oscap_docker_python/get_cve_input.py
+++ b/utils/oscap_docker_python/get_cve_input.py
@@ -113,13 +113,8 @@ class getInputCVE(object):
             if self.DEBUG:
                 stderr.write("No file in cache, fetching {0}\n".format(dest_file))
             return False
-        opener = urllib.OpenerDirector()
-        opener.add_handler(urllib.HTTPHandler())
-        opener.add_handler(urllib.HTTPSHandler())
-        opener.add_handler(urllib.HTTPDefaultErrorHandler())
-        # Extra for handling redirects
-        opener.add_handler(urllib.HTTPErrorProcessor())
-        opener.add_handler(urllib.HTTPRedirectHandler())
+
+        opener = urllib.build_opener()
         # Add the header
         opener.addheaders = self.hdr2
         # Grab the header
-- 
2.7.4