summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGinnis <sean.mcginnis@huawei.com>2017-12-20 10:59:48 -0600
committerSean McGinnis <sean.mcginnis@huawei.com>2017-12-21 16:08:55 -0600
commitadb141a2626192e8f45a911291895716d7c1c8a4 (patch)
treefbc8ec95e6c00f798996abb07fc0a90a67475069
parent7b34445a3cf2c87cc096d064725661f6ca320ee9 (diff)
downloadpython-cinderclient-adb141a2626192e8f45a911291895716d7c1c8a4.tar.gz
Deprecate multiattach flag on volume create
This form of multiattach was never fully supported and is now being replaced by the new mutliattach workflow with Nova. As part of this, volume type extra specs will be used to indicate multiattach ability and will allow retyping between volume types to change the flag after creation. That work is still in progress and has some potential to change. But we know we are not going to support this old style, so we should get that deprecated now so we can remove it and not cause any confusion. Change-Id: Icbb9c0ca89b25620cedff6cac7a4723e7126eca6
-rw-r--r--cinderclient/v2/volumes.py11
-rw-r--r--cinderclient/v3/volumes.py11
-rw-r--r--releasenotes/notes/deprecate-allow-multiattach-2213a100c65a95c1.yaml5
3 files changed, 25 insertions, 2 deletions
diff --git a/cinderclient/v2/volumes.py b/cinderclient/v2/volumes.py
index 0062794..53229ab 100644
--- a/cinderclient/v2/volumes.py
+++ b/cinderclient/v2/volumes.py
@@ -15,6 +15,8 @@
"""Volume interface (v2 extension)."""
+import warnings
+
from cinderclient.apiclient import base as common_base
from cinderclient import base
@@ -259,7 +261,7 @@ class VolumeManager(base.ManagerWithFind):
: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
+ one instance (deprecated)
:rtype: :class:`Volume`
"""
if metadata is None:
@@ -267,6 +269,13 @@ 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,
diff --git a/cinderclient/v3/volumes.py b/cinderclient/v3/volumes.py
index 99006b4..9a44a8e 100644
--- a/cinderclient/v3/volumes.py
+++ b/cinderclient/v3/volumes.py
@@ -14,6 +14,8 @@
# under the License.
"""Volume interface (v3 extension)."""
+import warnings
+
from cinderclient import api_versions
from cinderclient.apiclient import base as common_base
from cinderclient import base
@@ -95,7 +97,7 @@ class VolumeManager(volumes.VolumeManager):
: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
+ one instance (deprecated)
:param backup_id: ID of the backup
:rtype: :class:`Volume`
"""
@@ -104,6 +106,13 @@ 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,
diff --git a/releasenotes/notes/deprecate-allow-multiattach-2213a100c65a95c1.yaml b/releasenotes/notes/deprecate-allow-multiattach-2213a100c65a95c1.yaml
new file mode 100644
index 0000000..7ace9d9
--- /dev/null
+++ b/releasenotes/notes/deprecate-allow-multiattach-2213a100c65a95c1.yaml
@@ -0,0 +1,5 @@
+---
+deprecations:
+ - |
+ The ``--allow-multiattach`` flag on volume creation has now been marked
+ deprecated and will be removed in a future release.