components/openstack/cinder/patches/07-launchpad-1460156.patch
author Devjani Ray <devjani.ray@oracle.com>
Fri, 05 Feb 2016 17:54:17 -0500
changeset 5405 66fd59fecd68
parent 4189 components/openstack/cinder/patches/07-zfssa-pep-476.patch@599f274b9bcc
permissions -rw-r--r--
PSARC 2015/535 OpenStack service updates for Kilo PSARC 2015/458 aioeventlet - asyncio event loop scheduling callbacks in eventlet PSARC 2015/460 msgpack - C/Python bindings for MessagePack (de)serializer data PSARC 2015/466 openstackclient - OpenStack Command-line Client PSARC 2015/467 oslo.versionedobjects - Oslo Versioned Objects library PSARC 2015/468 pint - A physical quantities module PSARC 2015/469 pysaml2 - A pure Python implementation of SAML2 PSARC 2015/471 semantic_version - A library implementing the 'SemVer' scheme PSARC 2015/472 testresources - PyUnit extension for managing expensive test resources PSARC 2015/473 testscenarios - Extensions to Python unittest to support scenarios PSARC 2015/474 trollius - Port of the Tulip project (asyncio module, PEP 3156) on Python 2 PSARC 2015/475 urllib3 - HTTP library with thread-safe connection pooling, file post, and more PSARC 2015/520 oslo.concurrency - Oslo Concurrency library PSARC 2015/521 oslo.log - Oslo Logging Configuration library PSARC 2015/529 oslo.policy - Oslo Policy library PSARC 2015/530 psutil - Python system and process utilities PSARC 2015/538 fixtures - Python module to support reusable state for writing clean tests PSARC 2015/539 sqlparse - An SQL parser module for Python PSARC 2016/017 extras - Useful extra utilities for Python PSARC 2016/018 linecache2 - Port of the standard linecache module PSARC 2016/019 python-mimeparse - Basic functions for parsing mime-types PSARC 2016/020 testtools - Extensions to the Python unit testing framework PSARC 2016/021 traceback2 - Port of the standard traceback module PSARC 2016/014 OpenStack Cinder NFS driver for Solaris 22384068 OpenStack service updates for Kilo (Umbrella) 21974208 The Python module msgpack should be added to Userland 22010630 The Python trollius module should be added to Userland 22011755 The Python module pint should be added to Userland 22012256 The Python aioeventlet module should be added to Userland 22012282 The Python oslo.versionedobjects module should be added to Userland 22012317 The Python semantic_version module should be added to Userland 22012321 The Python testresources module should be added to Userland 22012329 The Python testscenarios module should be added to Userland 22012336 The Python urllib3 module should be added to Userland 22012343 The Python openstackclient module should be added to Userland 22299389 The Python oslo.concurrency module should be added to Userland 22299409 The Python oslo.log module should be added to Userland 22299418 The Python oslo.policy module should be added to Userland 22299469 The Python psutil module should be added to Userland 22337793 The Python sqlparse module should be added to Userland 22338325 The Python fixtures module should be added to Userland 22535728 The Python testtools module should be added to Userland 22535739 The Python extras module should be added to Userland 22535748 The Python linecache2 module should be added to Userland 22535753 The Python traceback2 module should be added to Userland 22535760 The Python python-mimeparse module should be added to Userland 18961001 Image filtering does not function as expected 21678935 NFS for Cinder in Solaris OpenStack 22548630 derived manifest should not enforce presence of global when installing from UAR 22629795 problem in SERVICE/KEYSTONE

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.

commit 814cbb8a937e2a01f2c8814dd032c0f12baa6fd4
Author: Diem Tran <[email protected]>
Date:   Wed Jul 1 21:12:48 2015 +0000

    Fix PEP476 & format message of Oracle ZFSSA drivers
    
    * Handles the PEP 476 by opting out certificate verification.
    * Fix debug format messages in restclient.py
    
    Change-Id: Iaf9e546f0aed6b57fe9c2bf43aa2ce003a05ddf8
    Closes-Bug: #1460156

--- cinder-2015.1.2/cinder/volume/drivers/zfssa/restclient.py.~1~	2015-10-13 09:27:35.000000000 -0700
+++ cinder-2015.1.2/cinder/volume/drivers/zfssa/restclient.py	2016-01-31 00:56:12.410126083 -0800
@@ -1,4 +1,4 @@
-# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
 #
 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
 #    not use this file except in compliance with the License. You may obtain
@@ -17,6 +17,7 @@ ZFS Storage Appliance REST API Client Pr
 
 import httplib
 import json
+import ssl
 import StringIO
 import time
 import urllib2
@@ -268,14 +269,27 @@ class RestClientURL(object):
         retry = 0
         response = None
 
-        LOG.debug('Request: %s %s' % (request, zfssaurl))
+        LOG.debug('Request: %(request)s %(url)s',
+                  {'request': request, 'url': zfssaurl})
         LOG.debug('Out headers: %s' % out_hdrs)
         if body and body != '':
             LOG.debug('Body: %s' % body)
 
+        context = None
+        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)
@@ -315,8 +329,9 @@ class RestClientURL(object):
 
             break
 
-        if response and response.getcode() == httplib.SERVICE_UNAVAILABLE and \
-           retry >= maxreqretries:
+        if (response and
+            (response.getcode() == httplib.SERVICE_UNAVAILABLE and
+                retry >= maxreqretries)):
             raise RestClientError(response.getcode(), name="ERR_HTTPError",
                                   message="REST Not Available: Disabled")