Skip to content

Commit 36a2f4b

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Deprecate multiattach flag on volume create"
2 parents 801ec5a + adb141a commit 36a2f4b

3 files changed

Lines changed: 25 additions & 2 deletions

File tree

cinderclient/v2/volumes.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
"""Volume interface (v2 extension)."""
1717

18+
import warnings
19+
1820
from cinderclient.apiclient import base as common_base
1921
from cinderclient import base
2022

@@ -259,14 +261,21 @@ def create(self, size, consistencygroup_id=None,
259261
:param scheduler_hints: (optional extension) arbitrary key-value pairs
260262
specified by the client to help boot an instance
261263
:param multiattach: Allow the volume to be attached to more than
262-
one instance
264+
one instance (deprecated)
263265
:rtype: :class:`Volume`
264266
"""
265267
if metadata is None:
266268
volume_metadata = {}
267269
else:
268270
volume_metadata = metadata
269271

272+
if multiattach:
273+
warnings.warn('The ``multiattach`` volume create flag is '
274+
'deprecated and will be removed in a future '
275+
'release. Multiattach capability is now controlled '
276+
'using volume type extra specs.',
277+
DeprecationWarning)
278+
270279
body = {'volume': {'size': size,
271280
'consistencygroup_id': consistencygroup_id,
272281
'snapshot_id': snapshot_id,

cinderclient/v3/volumes.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# under the License.
1515

1616
"""Volume interface (v3 extension)."""
17+
import warnings
18+
1719
from cinderclient import api_versions
1820
from cinderclient.apiclient import base as common_base
1921
from cinderclient import base
@@ -95,7 +97,7 @@ def create(self, size, consistencygroup_id=None,
9597
:param scheduler_hints: (optional extension) arbitrary key-value pairs
9698
specified by the client to help boot an instance
9799
:param multiattach: Allow the volume to be attached to more than
98-
one instance
100+
one instance (deprecated)
99101
:param backup_id: ID of the backup
100102
:rtype: :class:`Volume`
101103
"""
@@ -104,6 +106,13 @@ def create(self, size, consistencygroup_id=None,
104106
else:
105107
volume_metadata = metadata
106108

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+
107116
body = {'volume': {'size': size,
108117
'consistencygroup_id': consistencygroup_id,
109118
'snapshot_id': snapshot_id,
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
deprecations:
3+
- |
4+
The ``--allow-multiattach`` flag on volume creation has now been marked
5+
deprecated and will be removed in a future release.

0 commit comments

Comments
 (0)