summaryrefslogtreecommitdiffstats
path: root/snaps/config/volume.py
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2018-03-07 13:01:37 -0700
committerspisarski <s.pisarski@cablelabs.com>2018-03-08 14:02:05 -0700
commitf77540b440d3e5224eb1648339dc8c945f29bbe2 (patch)
tree84856cebdfb36f9c758d43bb127d1b91b88cc7d6 /snaps/config/volume.py
parente4563aec1eb8f98e5e42fe513918432eddadcd37 (diff)
Ensure the project for volumes are handled properly.
Although this patch has added the project_name member to VolumeConfig, it does not work properly due to a cinder bug https://bugs.launchpad.net/cinder/+bug/1641982. However, the code will now allow for volumes with the same name to be created on the same pod just as long as they do not exist within the same project/tenant. JIRA: SNAPS-270 Change-Id: Ia6f98e9b66793a69c0205d2d8e38bb3d03f3333e Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/config/volume.py')
-rw-r--r--snaps/config/volume.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/snaps/config/volume.py b/snaps/config/volume.py
index a31e8f5..0b4b73e 100644
--- a/snaps/config/volume.py
+++ b/snaps/config/volume.py
@@ -20,6 +20,9 @@ class VolumeConfig(object):
"""
Constructor
:param name: the volume's name (required)
+ :param project_name: the name of the project to associate (optional)
+ note: due to a bug in the Cinder API, this functionality will not
+ work. see https://bugs.launchpad.net/cinder/+bug/1641982
:param description: the volume's name (optional)
:param size: the volume's size in GB (default 1)
:param image_name: when a glance image is used for the image source
@@ -32,6 +35,7 @@ class VolumeConfig(object):
"""
self.name = kwargs.get('name')
+ self.project_name = kwargs.get('project_name')
self.description = kwargs.get('description')
self.size = int(kwargs.get('size', 1))
self.image_name = kwargs.get('image_name')