Browse Source

Merge "Drop support for --allow-multiattach"

tags/5.0.0
Zuul 1 week ago
parent
commit
d83998f6f0

+ 7
- 6
cinderclient/tests/functional/test_cli.py View File

@@ -17,12 +17,13 @@ from cinderclient.tests.functional import base
17 17
 class CinderVolumeTests(base.ClientTestBase):
18 18
     """Check of base cinder volume commands."""
19 19
 
20
-    CREATE_VOLUME_PROPERTY = ('attachments', 'multiattach',
21
-                       'os-vol-tenant-attr:tenant_id',
22
-                       'availability_zone', 'bootable',
23
-                       'created_at', 'description', 'encrypted', 'id',
24
-                       'metadata', 'name', 'size', 'status',
25
-                       'user_id', 'volume_type')
20
+    CREATE_VOLUME_PROPERTY = (
21
+        'attachments',
22
+        'os-vol-tenant-attr:tenant_id',
23
+        'availability_zone', 'bootable',
24
+        'created_at', 'description', 'encrypted', 'id',
25
+        'metadata', 'name', 'size', 'status',
26
+        'user_id', 'volume_type')
26 27
 
27 28
     SHOW_VOLUME_PROPERTY = ('attachment_ids', 'attached_servers',
28 29
                        'availability_zone', 'bootable',

+ 0
- 14
cinderclient/tests/functional/test_volume_create_cli.py View File

@@ -10,11 +10,8 @@
10 10
 #    License for the specific language governing permissions and limitations
11 11
 #    under the License.
12 12
 
13
-import unittest
14
-
15 13
 import ddt
16 14
 import six
17
-
18 15
 from tempest.lib import exceptions
19 16
 
20 17
 from cinderclient.tests.functional import base
@@ -91,17 +88,6 @@ class CinderVolumeTestsWithParameters(base.ClientTestBase):
91 88
                                     format(volume_description))
92 89
         self.assertEqual(volume_description, volume['description'])
93 90
 
94
-    @unittest.skip("Skip until multiattach will be supported")
95
-    def test_volume_create_multiattach(self):
96
-        """Test steps:
97
-
98
-        1) create volume and allow multiattach
99
-        2) check that multiattach is true
100
-        """
101
-        volume = self.object_create('volume',
102
-                                    params='--allow-multiattach 1')
103
-        self.assertEqual('True', volume['multiattach'])
104
-
105 91
     def test_volume_create_metadata(self):
106 92
         """Test steps:
107 93
 

+ 0
- 1
cinderclient/tests/unit/v2/fakes.py View File

@@ -56,7 +56,6 @@ def _stub_volume(*args, **kwargs):
56 56
         "metadata": {},
57 57
         "status": "available",
58 58
         'description': None,
59
-        "multiattach": "false",
60 59
         "os-volume-replication:driver_data": None,
61 60
         "source_volid": None,
62 61
         "consistencygroup_id": None,

+ 4
- 4
cinderclient/tests/unit/v2/test_shell.py View File

@@ -105,7 +105,7 @@ class ShellTest(utils.TestCase):
105 105
                                'metadata': {'key1': '"--test1"'},
106 106
                                'volume_type': None,
107 107
                                'description': None,
108
-                               'multiattach': False}}
108
+                               }}
109 109
         self.assert_called_anytime('POST', '/volumes', expected)
110 110
 
111 111
     def test_metadata_args_limiter_display_name(self):
@@ -121,7 +121,7 @@ class ShellTest(utils.TestCase):
121 121
                                'metadata': {'key1': '"--t1"'},
122 122
                                'volume_type': None,
123 123
                                'description': None,
124
-                               'multiattach': False}}
124
+                               }}
125 125
         self.assert_called_anytime('POST', '/volumes', expected)
126 126
 
127 127
     def test_delimit_metadata_args(self):
@@ -137,7 +137,7 @@ class ShellTest(utils.TestCase):
137 137
                                             'key2': '"test2"'},
138 138
                                'volume_type': None,
139 139
                                'description': None,
140
-                               'multiattach': False}}
140
+                               }}
141 141
         self.assert_called_anytime('POST', '/volumes', expected)
142 142
 
143 143
     def test_delimit_metadata_args_display_name(self):
@@ -153,7 +153,7 @@ class ShellTest(utils.TestCase):
153 153
                                'metadata': {'key1': '"t1"'},
154 154
                                'volume_type': None,
155 155
                                'description': None,
156
-                               'multiattach': False}}
156
+                               }}
157 157
         self.assert_called_anytime('POST', '/volumes', expected)
158 158
 
159 159
     def test_list_filter_status(self):

+ 1
- 1
cinderclient/tests/unit/v2/test_volumes.py View File

@@ -100,7 +100,7 @@ class VolumesTest(utils.TestCase):
100 100
                                'volume_type': None,
101 101
                                'metadata': {},
102 102
                                'consistencygroup_id': None,
103
-                               'multiattach': False},
103
+                               },
104 104
                     'OS-SCH-HNT:scheduler_hints': 'uuid'}
105 105
         cs.assert_called('POST', '/volumes', body=expected)
106 106
         self._assert_request_id(vol)

+ 0
- 2
cinderclient/tests/unit/v3/test_shell.py View File

@@ -692,7 +692,6 @@ class ShellTest(utils.TestCase):
692 692
                                'metadata': {},
693 693
                                'volume_type': '4321',
694 694
                                'description': None,
695
-                               'multiattach': False,
696 695
                                'backup_id': None}}
697 696
         self.assert_called_anytime('POST', '/volumes', expected)
698 697
 
@@ -715,7 +714,6 @@ class ShellTest(utils.TestCase):
715 714
                                'metadata': {},
716 715
                                'volume_type': None,
717 716
                                'description': None,
718
-                               'multiattach': False,
719 717
                                'backup_id': None}}
720 718
         expected['volume'].update(update)
721 719
         self.assert_called_anytime('POST', '/volumes', body=expected)

+ 0
- 1
cinderclient/tests/unit/v3/test_volumes.py View File

@@ -83,7 +83,6 @@ class VolumesTest(utils.TestCase):
83 83
                                'volume_type': '5678',
84 84
                                'metadata': {},
85 85
                                'consistencygroup_id': None,
86
-                               'multiattach': False,
87 86
                                'group_id': '1234',
88 87
                                'backup_id': None}}
89 88
         cs.assert_called('POST', '/volumes', body=expected)

+ 1
- 8
cinderclient/v2/shell.py View File

@@ -292,12 +292,6 @@ class CheckSizeArgForCreate(argparse.Action):
292 292
            help='Scheduler hint, similar to nova. Repeat option to set '
293 293
                 'multiple hints. Values with the same key will be stored '
294 294
                 'as a list.')
295
-@utils.arg('--allow-multiattach',
296
-           dest='multiattach',
297
-           action="store_true",
298
-           help=('Allow volume to be attached more than once. (DEPRECATED)'
299
-                 ' Default=False'),
300
-           default=False)
301 295
 def do_create(cs, args):
302 296
     """Creates a volume."""
303 297
     # NOTE(thingee): Backwards-compatibility with v1 args
@@ -339,8 +333,7 @@ def do_create(cs, args):
339 333
                                availability_zone=args.availability_zone,
340 334
                                imageRef=image_ref,
341 335
                                metadata=volume_metadata,
342
-                               scheduler_hints=hints,
343
-                               multiattach=args.multiattach)
336
+                               scheduler_hints=hints)
344 337
 
345 338
     info = dict()
346 339
     volume = cs.volumes.get(volume.id)

+ 1
- 14
cinderclient/v2/volumes.py View File

@@ -15,8 +15,6 @@
15 15
 
16 16
 """Volume interface (v2 extension)."""
17 17
 
18
-import warnings
19
-
20 18
 from cinderclient.apiclient import base as common_base
21 19
 from cinderclient import base
22 20
 
@@ -233,8 +231,7 @@ class VolumeManager(base.ManagerWithFind):
233 231
                source_volid=None, name=None, description=None,
234 232
                volume_type=None, user_id=None,
235 233
                project_id=None, availability_zone=None,
236
-               metadata=None, imageRef=None, scheduler_hints=None,
237
-               multiattach=False):
234
+               metadata=None, imageRef=None, scheduler_hints=None):
238 235
         """Create a volume.
239 236
 
240 237
         :param size: Size of volume in GB
@@ -251,8 +248,6 @@ class VolumeManager(base.ManagerWithFind):
251 248
         :param source_volid: ID of source volume to clone from
252 249
         :param scheduler_hints: (optional extension) arbitrary key-value pairs
253 250
                             specified by the client to help boot an instance
254
-        :param multiattach: Allow the volume to be attached to more than
255
-                            one instance (deprecated)
256 251
         :rtype: :class:`Volume`
257 252
         """
258 253
         if metadata is None:
@@ -260,13 +255,6 @@ class VolumeManager(base.ManagerWithFind):
260 255
         else:
261 256
             volume_metadata = metadata
262 257
 
263
-        if multiattach:
264
-            warnings.warn('The ``multiattach`` volume create flag is '
265
-                          'deprecated and will be removed in a future '
266
-                          'release. Multiattach capability is now controlled '
267
-                          'using volume type extra specs.',
268
-                          DeprecationWarning)
269
-
270 258
         body = {'volume': {'size': size,
271 259
                            'consistencygroup_id': consistencygroup_id,
272 260
                            'snapshot_id': snapshot_id,
@@ -277,7 +265,6 @@ class VolumeManager(base.ManagerWithFind):
277 265
                            'metadata': volume_metadata,
278 266
                            'imageRef': imageRef,
279 267
                            'source_volid': source_volid,
280
-                           'multiattach': multiattach,
281 268
                            }}
282 269
 
283 270
         if scheduler_hints:

+ 0
- 7
cinderclient/v3/shell.py View File

@@ -622,12 +622,6 @@ def do_reset_state(cs, args):
622 622
            help='Scheduler hint, similar to nova. Repeat option to set '
623 623
                 'multiple hints. Values with the same key will be stored '
624 624
                 'as a list.')
625
-@utils.arg('--allow-multiattach',
626
-           dest='multiattach',
627
-           action="store_true",
628
-           help=('Allow volume to be attached more than once. (DEPRECATED)'
629
-                 ' Default=False'),
630
-           default=False)
631 625
 @utils.arg('--poll',
632 626
            action="store_true",
633 627
            help=('Wait for volume creation until it completes.'))
@@ -682,7 +676,6 @@ def do_create(cs, args):
682 676
                                imageRef=image_ref,
683 677
                                metadata=volume_metadata,
684 678
                                scheduler_hints=hints,
685
-                               multiattach=args.multiattach,
686 679
                                backup_id=backup_id)
687 680
 
688 681
     info = dict()

+ 1
- 12
cinderclient/v3/volumes.py View File

@@ -14,7 +14,6 @@
14 14
 #    under the License.
15 15
 
16 16
 """Volume interface (v3 extension)."""
17
-import warnings
18 17
 
19 18
 from cinderclient import api_versions
20 19
 from cinderclient.apiclient import base as common_base
@@ -78,7 +77,7 @@ class VolumeManager(volumes.VolumeManager):
78 77
                volume_type=None, user_id=None,
79 78
                project_id=None, availability_zone=None,
80 79
                metadata=None, imageRef=None, scheduler_hints=None,
81
-               multiattach=False, backup_id=None):
80
+               backup_id=None):
82 81
         """Create a volume.
83 82
 
84 83
         :param size: Size of volume in GB
@@ -96,8 +95,6 @@ class VolumeManager(volumes.VolumeManager):
96 95
         :param source_volid: ID of source volume to clone from
97 96
         :param scheduler_hints: (optional extension) arbitrary key-value pairs
98 97
                             specified by the client to help boot an instance
99
-        :param multiattach: Allow the volume to be attached to more than
100
-                            one instance (deprecated)
101 98
         :param backup_id: ID of the backup
102 99
         :rtype: :class:`Volume`
103 100
         """
@@ -106,13 +103,6 @@ class VolumeManager(volumes.VolumeManager):
106 103
         else:
107 104
             volume_metadata = metadata
108 105
 
109
-        if multiattach:
110
-            warnings.warn('The ``multiattach`` volume create flag is '
111
-                          'deprecated and will be removed in a future '
112
-                          'release. Multiattach capability is now controlled '
113
-                          'using volume type extra specs.',
114
-                          DeprecationWarning)
115
-
116 106
         body = {'volume': {'size': size,
117 107
                            'consistencygroup_id': consistencygroup_id,
118 108
                            'snapshot_id': snapshot_id,
@@ -123,7 +113,6 @@ class VolumeManager(volumes.VolumeManager):
123 113
                            'metadata': volume_metadata,
124 114
                            'imageRef': imageRef,
125 115
                            'source_volid': source_volid,
126
-                           'multiattach': multiattach,
127 116
                            'backup_id': backup_id
128 117
                            }}
129 118
 

+ 4
- 0
releasenotes/notes/cinderclient-5-de0508ce5a221d21.yaml View File

@@ -22,3 +22,7 @@ upgrade:
22 22
     for several releases and have now been removed. After upgrading, use the
23 23
     equivalent ``--os_project_name``, ``--os_project_id``, ``OS_PROJECT_NAME``
24 24
     and ``OS_PROJECT_ID``.
25
+  - |
26
+    The deprecated volume create option ``--allow-multiattach`` has now been
27
+    removed. Multiattach capability is now controlled using `volume-type extra
28
+    specs <https://docs.openstack.org/cinder/latest/admin/blockstorage-volume-multiattach.html>`_.

Loading…
Cancel
Save