# HG changeset patch # User david.comay@oracle.com # Date 1429898036 25200 # Node ID 599f274b9bcc4eb8079abb26c1349ec3a82c94f6 # Parent 23e54414e57cdad09f1b3a6a78d50ed7840b1d83 20938347 ZFSSA Cinder driver needs to account for PEP 476 in Python 2.7.9 diff -r 23e54414e57c -r 599f274b9bcc components/openstack/cinder/patches/07-zfssa-pep-476.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/components/openstack/cinder/patches/07-zfssa-pep-476.patch Fri Apr 24 10:53:56 2015 -0700 @@ -0,0 +1,36 @@ +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)