22871933 Various OpenStack services could be a bit less noisy log-wise
authordavid.comay@oracle.com
Mon, 13 Jun 2016 23:38:24 -0700
changeset 6175 ddba0e1c2f4f
parent 6174 e626f941a659
child 6176 8b75bcaa9d4d
22871933 Various OpenStack services could be a bit less noisy log-wise
components/openstack/cinder/patches/13-launchpad-1482873.patch
components/openstack/cinder/patches/14-launchpad-1499921.patch
components/openstack/glance/patches/14-launchpad-1471080.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/openstack/cinder/patches/13-launchpad-1482873.patch	Mon Jun 13 23:38:24 2016 -0700
@@ -0,0 +1,89 @@
+This patch has been integrated into Mitaka but has not yet been
+back-ported to Kilo.
+
+commit 000aeb9df77dc61df9f597421a10a77c32bd89b0
+Author: Yusuke Hayashi <[email protected]>
+Date:   Sat Aug 8 23:12:18 2015 +0900
+
+    Update deprecated version of novaclient
+    
+    Update novaclient v1.1 to v2
+    because warning messages are shown as below when executing run_test.sh:
+    
+    UserWarning: Module novaclient.v1_1 is deprecated
+    (taken as a basis for novaclient.v2).
+    The preferable way to get client class or object
+    you can find in novaclient.client module.
+    
+    Change-Id: I26602aceadac9a43d4fbaa14791bf6756eef9874
+    Partial-Bug: #1482873
+
+--- cinder-2015.1.2/cinder/compute/nova.py.~1~	2015-10-13 09:27:35.000000000 -0700
++++ cinder-2015.1.2/cinder/compute/nova.py	2016-03-03 19:10:27.797293767 -0800
+@@ -20,9 +20,9 @@ Handles all requests to Nova.
+ from novaclient import exceptions as nova_exceptions
+ from novaclient import extension
+ from novaclient import service_catalog
+-from novaclient.v1_1 import client as nova_client
+-from novaclient.v1_1.contrib import assisted_volume_snapshots
+-from novaclient.v1_1.contrib import list_extensions
++from novaclient.v2 import client as nova_client
++from novaclient.v2.contrib import assisted_volume_snapshots
++from novaclient.v2.contrib import list_extensions
+ from oslo_config import cfg
+ from oslo_log import log as logging
+ from requests import exceptions as request_exceptions
+@@ -175,6 +175,7 @@ class API(base.Base):
+     def create_volume_snapshot(self, context, volume_id, create_info):
+         nova = novaclient(context, admin_endpoint=True, privileged_user=True)
+ 
++        # pylint: disable-msg=E1101
+         nova.assisted_volume_snapshots.create(
+             volume_id,
+             create_info=create_info)
+@@ -182,6 +183,7 @@ class API(base.Base):
+     def delete_volume_snapshot(self, context, snapshot_id, delete_info):
+         nova = novaclient(context, admin_endpoint=True, privileged_user=True)
+ 
++        # pylint: disable-msg=E1101
+         nova.assisted_volume_snapshots.delete(
+             snapshot_id,
+             delete_info=delete_info)
+--- cinder-2015.1.2/cinder/tests/compute/test_nova.py.~1~	2015-10-13 09:27:35.000000000 -0700
++++ cinder-2015.1.2/cinder/tests/compute/test_nova.py	2016-03-03 19:10:48.985988475 -0800
+@@ -38,7 +38,7 @@ class NovaClientTestCase(test.TestCase):
+         self.override_config('os_privileged_user_name', 'adminuser')
+         self.override_config('os_privileged_user_password', 'strongpassword')
+ 
+-    @mock.patch('novaclient.v1_1.client.Client')
++    @mock.patch('novaclient.v2.client.Client')
+     def test_nova_client_regular(self, p_client):
+         nova.novaclient(self.ctx)
+         p_client.assert_called_once_with(
+@@ -47,7 +47,7 @@ class NovaClientTestCase(test.TestCase):
+             insecure=False, endpoint_type='publicURL', cacert=None,
+             timeout=None, extensions=nova.nova_extensions)
+ 
+-    @mock.patch('novaclient.v1_1.client.Client')
++    @mock.patch('novaclient.v2.client.Client')
+     def test_nova_client_admin_endpoint(self, p_client):
+         nova.novaclient(self.ctx, admin_endpoint=True)
+         p_client.assert_called_once_with(
+@@ -56,7 +56,7 @@ class NovaClientTestCase(test.TestCase):
+             insecure=False, endpoint_type='adminURL', cacert=None,
+             timeout=None, extensions=nova.nova_extensions)
+ 
+-    @mock.patch('novaclient.v1_1.client.Client')
++    @mock.patch('novaclient.v2.client.Client')
+     def test_nova_client_privileged_user(self, p_client):
+         nova.novaclient(self.ctx, privileged_user=True)
+         p_client.assert_called_once_with(
+@@ -65,7 +65,7 @@ class NovaClientTestCase(test.TestCase):
+             insecure=False, endpoint_type='publicURL', cacert=None,
+             timeout=None, extensions=nova.nova_extensions)
+ 
+-    @mock.patch('novaclient.v1_1.client.Client')
++    @mock.patch('novaclient.v2.client.Client')
+     def test_nova_client_custom_region(self, p_client):
+         self.override_config('os_region_name', 'farfaraway')
+         nova.novaclient(self.ctx)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/openstack/cinder/patches/14-launchpad-1499921.patch	Mon Jun 13 23:38:24 2016 -0700
@@ -0,0 +1,15 @@
+In-house patch to address the deprecation warning described in
+Launchpad bug 1499921. A similar upstream patch was abadoned although
+the issue still remains as of Mitaka.
+
+--- cinder-2015.1.2/etc/cinder/api-paste.ini.~1~	2015-10-13 09:27:32.000000000 -0700
++++ cinder-2015.1.2/etc/cinder/api-paste.ini	2016-05-28 20:05:58.568790609 -0700
+@@ -35,7 +35,7 @@ enabled = yes
+ paste.filter_factory = cinder.api.middleware.auth:NoAuthMiddleware.factory
+ 
+ [filter:sizelimit]
+-paste.filter_factory = cinder.api.middleware.sizelimit:RequestBodySizeLimiter.factory
++paste.filter_factory = oslo_middleware.sizelimit:RequestBodySizeLimiter.factory
+ 
+ [app:apiv1]
+ paste.app_factory = cinder.api.v1.router:APIRouter.factory
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/openstack/glance/patches/14-launchpad-1471080.patch	Mon Jun 13 23:38:24 2016 -0700
@@ -0,0 +1,40 @@
+commit 356e66c2397a4a1ae3dd1fca2870958f5969aceb
+Author: wangxiyuan <[email protected]>
+Date:   Fri Jul 3 11:45:57 2015 +0800
+
+    Fix wrong check when create image without data.
+    
+    The default value of 'locations' is [].So there is a wrong check in
+    db/sqlalchemy/api.py.
+    When create an image without data, The function '_image_locations_set'
+    should not be executed.
+    
+    Change-Id: Ie4cb29ab0d714d3ce67f717d5eaf641424efa5b7
+    Closes-bug:#1471080
+
+--- glance-2015.1.2/glance/db/sqlalchemy/api.py.~1~	2015-10-13 09:38:23.000000000 -0700
++++ glance-2015.1.2/glance/db/sqlalchemy/api.py	2016-03-04 01:02:00.749647525 -0800
+@@ -790,7 +790,7 @@ def _image_update(context, values, image
+         _set_properties_for_image(context, image_ref, properties, purge_props,
+                                   session)
+ 
+-        if location_data is not None:
++        if location_data:
+             _image_locations_set(context, image_ref.id, location_data,
+                                  session=session)
+ 
+--- glance-2015.1.2/glance/tests/functional/db/base.py.~1~	2015-10-13 09:38:23.000000000 -0700
++++ glance-2015.1.2/glance/tests/functional/db/base.py	2016-03-04 01:02:00.751553768 -0800
+@@ -191,6 +191,12 @@ class DriverTests(object):
+                   for l in image['locations']]
+         self.assertEqual(locations, actual)
+ 
++    def test_image_create_without_locations(self):
++        locations = []
++        fixture = {'status': 'queued',
++                   'locations': locations}
++        self.db_api.image_create(self.context, fixture)
++
+     def test_image_create_with_location_data(self):
+         location_data = [{'url': 'a', 'metadata': {'key': 'value'},
+                           'status': 'active'},