diff options
author | Sean McGinnis <sean.mcginnis@gmail.com> | 2019-04-18 12:22:19 -0500 |
---|---|---|
committer | Brian Rosmaita <rosmaita.fossdev@gmail.com> | 2019-09-11 08:06:43 -0400 |
commit | 3c1b417959689c85a2f54505057ca995fedca075 (patch) | |
tree | 584e08c66032024271b9fbd9dd843b6f43471deb | |
parent | 61fec71adbcff8b62312d2e814c8af4879d169be (diff) | |
download | python-cinderclient-3c1b417959689c85a2f54505057ca995fedca075.tar.gz |
Drop support for --allow-multiattach
The ability to enable multiattach on the command line was deprecated in
Queens with the full implementation of multiattach enabling it through
volume type extra specs. This removes the command line arg and handling
for specifying it with volume creation.
Change-Id: Ifc0c874657f959266050cd1a7a40e6ecccc8c114
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
-rw-r--r-- | cinderclient/tests/functional/test_cli.py | 13 | ||||
-rw-r--r-- | cinderclient/tests/functional/test_volume_create_cli.py | 14 | ||||
-rw-r--r-- | cinderclient/tests/unit/v2/fakes.py | 1 | ||||
-rw-r--r-- | cinderclient/tests/unit/v2/test_shell.py | 8 | ||||
-rw-r--r-- | cinderclient/tests/unit/v2/test_volumes.py | 2 | ||||
-rw-r--r-- | cinderclient/tests/unit/v3/test_shell.py | 2 | ||||
-rw-r--r-- | cinderclient/tests/unit/v3/test_volumes.py | 1 | ||||
-rw-r--r-- | cinderclient/v2/shell.py | 9 | ||||
-rw-r--r-- | cinderclient/v2/volumes.py | 15 | ||||
-rw-r--r-- | cinderclient/v3/shell.py | 7 | ||||
-rw-r--r-- | cinderclient/v3/volumes.py | 13 | ||||
-rw-r--r-- | releasenotes/notes/cinderclient-5-de0508ce5a221d21.yaml | 4 |
12 files changed, 19 insertions, 70 deletions
diff --git a/cinderclient/tests/functional/test_cli.py b/cinderclient/tests/functional/test_cli.py index bfa653f..0490df9 100644 --- a/cinderclient/tests/functional/test_cli.py +++ b/cinderclient/tests/functional/test_cli.py @@ -17,12 +17,13 @@ from cinderclient.tests.functional import base class CinderVolumeTests(base.ClientTestBase): """Check of base cinder volume commands.""" - CREATE_VOLUME_PROPERTY = ('attachments', 'multiattach', - 'os-vol-tenant-attr:tenant_id', - 'availability_zone', 'bootable', - 'created_at', 'description', 'encrypted', 'id', - 'metadata', 'name', 'size', 'status', - 'user_id', 'volume_type') + CREATE_VOLUME_PROPERTY = ( + 'attachments', + 'os-vol-tenant-attr:tenant_id', + 'availability_zone', 'bootable', + 'created_at', 'description', 'encrypted', 'id', + 'metadata', 'name', 'size', 'status', + 'user_id', 'volume_type') SHOW_VOLUME_PROPERTY = ('attachment_ids', 'attached_servers', 'availability_zone', 'bootable', diff --git a/cinderclient/tests/functional/test_volume_create_cli.py b/cinderclient/tests/functional/test_volume_create_cli.py index 87eaff2..deae383 100644 --- a/cinderclient/tests/functional/test_volume_create_cli.py +++ b/cinderclient/tests/functional/test_volume_create_cli.py @@ -10,11 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. -import unittest - import ddt import six - from tempest.lib import exceptions from cinderclient.tests.functional import base @@ -91,17 +88,6 @@ class CinderVolumeTestsWithParameters(base.ClientTestBase): format(volume_description)) self.assertEqual(volume_description, volume['description']) - @unittest.skip("Skip until multiattach will be supported") - def test_volume_create_multiattach(self): - """Test steps: - - 1) create volume and allow multiattach - 2) check that multiattach is true - """ - volume = self.object_create('volume', - params='--allow-multiattach 1') - self.assertEqual('True', volume['multiattach']) - def test_volume_create_metadata(self): """Test steps: diff --git a/cinderclient/tests/unit/v2/fakes.py b/cinderclient/tests/unit/v2/fakes.py index bd8bb34..0cf1faa 100644 --- a/cinderclient/tests/unit/v2/fakes.py +++ b/cinderclient/tests/unit/v2/fakes.py @@ -56,7 +56,6 @@ def _stub_volume(*args, **kwargs): "metadata": {}, "status": "available", 'description': None, - "multiattach": "false", "os-volume-replication:driver_data": None, "source_volid": None, "consistencygroup_id": None, diff --git a/cinderclient/tests/unit/v2/test_shell.py b/cinderclient/tests/unit/v2/test_shell.py index 1bc562b..22cb25e 100644 --- a/cinderclient/tests/unit/v2/test_shell.py +++ b/cinderclient/tests/unit/v2/test_shell.py @@ -105,7 +105,7 @@ class ShellTest(utils.TestCase): 'metadata': {'key1': '"--test1"'}, 'volume_type': None, 'description': None, - 'multiattach': False}} + }} self.assert_called_anytime('POST', '/volumes', expected) def test_metadata_args_limiter_display_name(self): @@ -121,7 +121,7 @@ class ShellTest(utils.TestCase): 'metadata': {'key1': '"--t1"'}, 'volume_type': None, 'description': None, - 'multiattach': False}} + }} self.assert_called_anytime('POST', '/volumes', expected) def test_delimit_metadata_args(self): @@ -137,7 +137,7 @@ class ShellTest(utils.TestCase): 'key2': '"test2"'}, 'volume_type': None, 'description': None, - 'multiattach': False}} + }} self.assert_called_anytime('POST', '/volumes', expected) def test_delimit_metadata_args_display_name(self): @@ -153,7 +153,7 @@ class ShellTest(utils.TestCase): 'metadata': {'key1': '"t1"'}, 'volume_type': None, 'description': None, - 'multiattach': False}} + }} self.assert_called_anytime('POST', '/volumes', expected) def test_list_filter_status(self): diff --git a/cinderclient/tests/unit/v2/test_volumes.py b/cinderclient/tests/unit/v2/test_volumes.py index 5240507..8704c66 100644 --- a/cinderclient/tests/unit/v2/test_volumes.py +++ b/cinderclient/tests/unit/v2/test_volumes.py @@ -100,7 +100,7 @@ class VolumesTest(utils.TestCase): 'volume_type': None, 'metadata': {}, 'consistencygroup_id': None, - 'multiattach': False}, + }, 'OS-SCH-HNT:scheduler_hints': 'uuid'} cs.assert_called('POST', '/volumes', body=expected) self._assert_request_id(vol) diff --git a/cinderclient/tests/unit/v3/test_shell.py b/cinderclient/tests/unit/v3/test_shell.py index f4aa598..e33bbec 100644 --- a/cinderclient/tests/unit/v3/test_shell.py +++ b/cinderclient/tests/unit/v3/test_shell.py @@ -658,7 +658,6 @@ class ShellTest(utils.TestCase): 'metadata': {}, 'volume_type': '4321', 'description': None, - 'multiattach': False, 'backup_id': None}} self.assert_called_anytime('POST', '/volumes', expected) @@ -681,7 +680,6 @@ class ShellTest(utils.TestCase): 'metadata': {}, 'volume_type': None, 'description': None, - 'multiattach': False, 'backup_id': None}} expected['volume'].update(update) self.assert_called_anytime('POST', '/volumes', body=expected) diff --git a/cinderclient/tests/unit/v3/test_volumes.py b/cinderclient/tests/unit/v3/test_volumes.py index 42e649b..79206f6 100644 --- a/cinderclient/tests/unit/v3/test_volumes.py +++ b/cinderclient/tests/unit/v3/test_volumes.py @@ -83,7 +83,6 @@ class VolumesTest(utils.TestCase): 'volume_type': '5678', 'metadata': {}, 'consistencygroup_id': None, - 'multiattach': False, 'group_id': '1234', 'backup_id': None}} cs.assert_called('POST', '/volumes', body=expected) diff --git a/cinderclient/v2/shell.py b/cinderclient/v2/shell.py index fb87a4f..20c7bd6 100644 --- a/cinderclient/v2/shell.py +++ b/cinderclient/v2/shell.py @@ -292,12 +292,6 @@ class CheckSizeArgForCreate(argparse.Action): help='Scheduler hint, similar to nova. Repeat option to set ' 'multiple hints. Values with the same key will be stored ' 'as a list.') -@utils.arg('--allow-multiattach', - dest='multiattach', - action="store_true", - help=('Allow volume to be attached more than once. (DEPRECATED)' - ' Default=False'), - default=False) def do_create(cs, args): """Creates a volume.""" # NOTE(thingee): Backwards-compatibility with v1 args @@ -339,8 +333,7 @@ def do_create(cs, args): availability_zone=args.availability_zone, imageRef=image_ref, metadata=volume_metadata, - scheduler_hints=hints, - multiattach=args.multiattach) + scheduler_hints=hints) info = dict() volume = cs.volumes.get(volume.id) diff --git a/cinderclient/v2/volumes.py b/cinderclient/v2/volumes.py index 6500fe8..3cc0d4a 100644 --- a/cinderclient/v2/volumes.py +++ b/cinderclient/v2/volumes.py @@ -15,8 +15,6 @@ """Volume interface (v2 extension).""" -import warnings - from cinderclient.apiclient import base as common_base from cinderclient import base @@ -233,8 +231,7 @@ class VolumeManager(base.ManagerWithFind): source_volid=None, name=None, description=None, volume_type=None, user_id=None, project_id=None, availability_zone=None, - metadata=None, imageRef=None, scheduler_hints=None, - multiattach=False): + metadata=None, imageRef=None, scheduler_hints=None): """Create a volume. :param size: Size of volume in GB @@ -251,8 +248,6 @@ class VolumeManager(base.ManagerWithFind): :param source_volid: ID of source volume to clone from :param scheduler_hints: (optional extension) arbitrary key-value pairs specified by the client to help boot an instance - :param multiattach: Allow the volume to be attached to more than - one instance (deprecated) :rtype: :class:`Volume` """ if metadata is None: @@ -260,13 +255,6 @@ class VolumeManager(base.ManagerWithFind): else: volume_metadata = metadata - if multiattach: - warnings.warn('The ``multiattach`` volume create flag is ' - 'deprecated and will be removed in a future ' - 'release. Multiattach capability is now controlled ' - 'using volume type extra specs.', - DeprecationWarning) - body = {'volume': {'size': size, 'consistencygroup_id': consistencygroup_id, 'snapshot_id': snapshot_id, @@ -277,7 +265,6 @@ class VolumeManager(base.ManagerWithFind): 'metadata': volume_metadata, 'imageRef': imageRef, 'source_volid': source_volid, - 'multiattach': multiattach, }} if scheduler_hints: diff --git a/cinderclient/v3/shell.py b/cinderclient/v3/shell.py index 436c80c..784f379 100644 --- a/cinderclient/v3/shell.py +++ b/cinderclient/v3/shell.py @@ -606,12 +606,6 @@ def do_reset_state(cs, args): help='Scheduler hint, similar to nova. Repeat option to set ' 'multiple hints. Values with the same key will be stored ' 'as a list.') -@utils.arg('--allow-multiattach', - dest='multiattach', - action="store_true", - help=('Allow volume to be attached more than once. (DEPRECATED)' - ' Default=False'), - default=False) @utils.arg('--poll', action="store_true", help=('Wait for volume creation until it completes.')) @@ -666,7 +660,6 @@ def do_create(cs, args): imageRef=image_ref, metadata=volume_metadata, scheduler_hints=hints, - multiattach=args.multiattach, backup_id=backup_id) info = dict() diff --git a/cinderclient/v3/volumes.py b/cinderclient/v3/volumes.py index d4b9637..7c161bc 100644 --- a/cinderclient/v3/volumes.py +++ b/cinderclient/v3/volumes.py @@ -14,7 +14,6 @@ # under the License. """Volume interface (v3 extension).""" -import warnings from cinderclient import api_versions from cinderclient.apiclient import base as common_base @@ -78,7 +77,7 @@ class VolumeManager(volumes.VolumeManager): volume_type=None, user_id=None, project_id=None, availability_zone=None, metadata=None, imageRef=None, scheduler_hints=None, - multiattach=False, backup_id=None): + backup_id=None): """Create a volume. :param size: Size of volume in GB @@ -96,8 +95,6 @@ class VolumeManager(volumes.VolumeManager): :param source_volid: ID of source volume to clone from :param scheduler_hints: (optional extension) arbitrary key-value pairs specified by the client to help boot an instance - :param multiattach: Allow the volume to be attached to more than - one instance (deprecated) :param backup_id: ID of the backup :rtype: :class:`Volume` """ @@ -106,13 +103,6 @@ class VolumeManager(volumes.VolumeManager): else: volume_metadata = metadata - if multiattach: - warnings.warn('The ``multiattach`` volume create flag is ' - 'deprecated and will be removed in a future ' - 'release. Multiattach capability is now controlled ' - 'using volume type extra specs.', - DeprecationWarning) - body = {'volume': {'size': size, 'consistencygroup_id': consistencygroup_id, 'snapshot_id': snapshot_id, @@ -123,7 +113,6 @@ class VolumeManager(volumes.VolumeManager): 'metadata': volume_metadata, 'imageRef': imageRef, 'source_volid': source_volid, - 'multiattach': multiattach, 'backup_id': backup_id }} diff --git a/releasenotes/notes/cinderclient-5-de0508ce5a221d21.yaml b/releasenotes/notes/cinderclient-5-de0508ce5a221d21.yaml index 6259e9f..d307182 100644 --- a/releasenotes/notes/cinderclient-5-de0508ce5a221d21.yaml +++ b/releasenotes/notes/cinderclient-5-de0508ce5a221d21.yaml @@ -22,3 +22,7 @@ upgrade: for several releases and have now been removed. After upgrading, use the equivalent ``--os_project_name``, ``--os_project_id``, ``OS_PROJECT_NAME`` and ``OS_PROJECT_ID``. + - | + The deprecated volume create option ``--allow-multiattach`` has now been + removed. Multiattach capability is now controlled using `volume-type extra + specs <https://docs.openstack.org/cinder/latest/admin/blockstorage-volume-multiattach.html>`_. |