components/openstack/cinder/patches/07-zfssa-pep-476.patch
branchs11u3-sru
changeset 6035 c9748fcc32de
parent 6016 a477397bba8b
child 6054 b5ae16fb8526
--- a/components/openstack/cinder/patches/07-zfssa-pep-476.patch	Mon May 16 14:46:20 2016 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-This patch is to work-around the fact that Python 2.7.9 and beyond have
-implemented PEP 476 which enabled certificate verification by default
-and ZFSSAs may not be deployed with a valid, CA-signed certificate.
-
-This patch may be suitable for pushing upsteam.
-
---- cinder-2014.2.2/cinder/volume/drivers/zfssa/restclient.py.~1~	2015-02-05 08:03:26.000000000 -0800
-+++ cinder-2014.2.2/cinder/volume/drivers/zfssa/restclient.py	2015-04-23 17:32:01.898738656 -0700
-@@ -17,6 +17,7 @@ ZFS Storage Appliance REST API Client Pr
- 
- import httplib
- import json
-+import ssl
- import StringIO
- import time
- import urllib2
-@@ -272,9 +273,18 @@ class RestClientURL(object):
-         if body and body != '':
-             LOG.debug('Body: %s' % body)
- 
-+        if hasattr(ssl, '_create_unverified_context'):
-+            context = ssl._create_unverified_context()
-+        else:
-+            context = None
-+
-         while retry < maxreqretries:
-             try:
--                response = urllib2.urlopen(req, timeout=self.timeout)
-+                if context:
-+                    response = urllib2.urlopen(req, timeout=self.timeout,
-+                        context=context)
-+                else:
-+                    response = urllib2.urlopen(req, timeout=self.timeout)
-             except urllib2.HTTPError as err:
-                 if err.code == httplib.NOT_FOUND:
-                     LOG.debug('REST Not Found: %s' % err.code)