From 9b0aa6ee37e40e98ac1f8c74ac85864af30458da Mon Sep 17 00:00:00 2001 From: shangxdy Date: Fri, 15 Jul 2016 15:27:59 +0800 Subject: Tosca-Pacer doesn't support https proxy. When access CSAR file which is URL and the protocol is https by proxy, it will be error and the information is below: toscaparser.common.exception.URLException: Failed to reach server "https://raw.githubusercontent.com/openstack/tosca- parser/master/toscaparser /tests/data/custom_types/wordpress.yaml". Reason is: Tunnel connection failed: 503 Service Unavailable. The reason of the error is urllib doesn't support https proxy. JIRA: PARSER-66 Change-Id: I82ec68d533743527fba613cc362e4241494359d4 Signed-off-by: 10013968 Signed-off-by: shangxdy --- tosca2heat/tosca-parser/toscaparser/utils/urlutils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tosca2heat/tosca-parser/toscaparser/utils/urlutils.py b/tosca2heat/tosca-parser/toscaparser/utils/urlutils.py index 8022158..34b6032 100644 --- a/tosca2heat/tosca-parser/toscaparser/utils/urlutils.py +++ b/tosca2heat/tosca-parser/toscaparser/utils/urlutils.py @@ -18,10 +18,10 @@ from toscaparser.utils.gettextutils import _ try: # Python 3.x - import urllib.request as urllib + import urllib.request as urllib2 except ImportError: # Python 2.x - import urllib + import urllib2 class UrlUtils(object): @@ -58,4 +58,4 @@ class UrlUtils(object): Returns true if the get call returns a 200 response code. Otherwise, returns false. """ - return urllib.urlopen(url).getcode() == 200 + return urllib2.urlopen(url).getcode() == 200 -- cgit 1.2.3-korg