From eb3b4851a95a4d6a7d14dd55940a54864431f89e Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 22 Dec 2020 18:26:58 +0900 Subject: [PATCH] Use volume v3 API by default Currently ec2api uses the volume v2 API by default, but v2 API was deprecated a while ago and will be removed fron cinder shortly. This patch ensures that ec2api uses the volume v3 API instead by default. Closes-Bug: #1908993 Change-Id: I280d3c009893c67d215b0c7106eec7fe2435c335 --- doc/source/configuration/tables/ec2api-clients.inc | 2 +- ec2api/clients.py | 2 +- ec2api/tests/unit/test_clients.py | 2 +- .../notes/use-volumev3-by-default-fa726fed293d94bb.yaml | 6 ++++++ 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/use-volumev3-by-default-fa726fed293d94bb.yaml diff --git a/doc/source/configuration/tables/ec2api-clients.inc b/doc/source/configuration/tables/ec2api-clients.inc index d073f291..e817cc1f 100644 --- a/doc/source/configuration/tables/ec2api-clients.inc +++ b/doc/source/configuration/tables/ec2api-clients.inc @@ -20,7 +20,7 @@ * - **[DEFAULT]** - - * - ``cinder_service_type`` = ``volumev2`` + * - ``cinder_service_type`` = ``volumev3`` - (String) Service type of Volume API, registered in Keystone catalog. diff --git a/ec2api/clients.py b/ec2api/clients.py index 184652ad..2ca188d4 100644 --- a/ec2api/clients.py +++ b/ec2api/clients.py @@ -32,7 +32,7 @@ ec2_opts = [ 'If it is obsolete v2, a lot of useful EC2 compliant ' 'instance properties will be unavailable.'), cfg.StrOpt('cinder_service_type', - default='volumev2', + default='volumev3', help='Service type of Volume API, registered in Keystone ' 'catalog.'), ] diff --git a/ec2api/tests/unit/test_clients.py b/ec2api/tests/unit/test_clients.py index 6ddc89b1..e27a054f 100644 --- a/ec2api/tests/unit/test_clients.py +++ b/ec2api/tests/unit/test_clients.py @@ -116,7 +116,7 @@ class ClientsTestCase(base.BaseTestCase): context = mock.NonCallableMock(session=mock.sentinel.session) res = clients.cinder(context) self.assertEqual(cinder.return_value, res) - cinder.assert_called_with('2', service_type='volumev2', + cinder.assert_called_with('2', service_type='volumev3', session=mock.sentinel.session) @mock.patch('keystoneclient.client.Client') diff --git a/releasenotes/notes/use-volumev3-by-default-fa726fed293d94bb.yaml b/releasenotes/notes/use-volumev3-by-default-fa726fed293d94bb.yaml new file mode 100644 index 00000000..ef798e70 --- /dev/null +++ b/releasenotes/notes/use-volumev3-by-default-fa726fed293d94bb.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - | + Default value of the ``cinder_service_type`` parameter has been changed + from ``volumev2`` to ``volume3``, because volume v2 API was already + deprecated and v3 API should be used instead.