libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject libcloud git commit: Added volume type to create_volume in openstack
Date Fri, 07 Aug 2015 21:42:35 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk 4cc3adfef -> ebe71ac1e


Added volume type to create_volume in openstack

Fx. to allow the choose between SATA and SSD

Closes #553

Signed-off-by: Tomaz Muraus <tomaz@tomaz.me>


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/ebe71ac1
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/ebe71ac1
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/ebe71ac1

Branch: refs/heads/trunk
Commit: ebe71ac1ea70706ca5025c755f3cc861863ac9a1
Parents: 4cc3adf
Author: Rico Echwald-Tijsen <rico@tijsen.net>
Authored: Wed Jul 22 13:21:44 2015 +0200
Committer: Tomaz Muraus <tomaz@tomaz.me>
Committed: Fri Aug 7 23:35:55 2015 +0200

----------------------------------------------------------------------
 CHANGES.rst                           | 5 +++++
 libcloud/compute/drivers/openstack.py | 9 +++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/ebe71ac1/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index e9ea207..5a22402 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -270,6 +270,11 @@ Compute
   (LIBCLOUD-723, GITHUB-548)
   [David Wilson]
 
+- Allow user to pass ``ex_volume_type`` argument to the ``create_volume`` method
+  in the OpennStack driver.
+  (GITHUB-553)
+  [Rico Echwald-Tijsen]
+
 Storage
 ~~~~~~~
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/ebe71ac1/libcloud/compute/drivers/openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/openstack.py b/libcloud/compute/drivers/openstack.py
index 469f5d6..4205d60 100644
--- a/libcloud/compute/drivers/openstack.py
+++ b/libcloud/compute/drivers/openstack.py
@@ -164,7 +164,8 @@ class OpenStackNodeDriver(NodeDriver, OpenStackDriverMixin):
         return self._to_nodes(
             self.connection.request('/servers/detail', params=params).object)
 
-    def create_volume(self, size, name, location=None, snapshot=None):
+    def create_volume(self, size, name, location=None, snapshot=None,
+                      ex_volume_type=None):
         """
         Create a new volume.
 
@@ -183,6 +184,10 @@ class OpenStackNodeDriver(NodeDriver, OpenStackDriverMixin):
                           volume.  (optional)
         :type snapshot:  :class:`.VolumeSnapshot`
 
+        :param ex_volume_type: What kind of volume to create.
+                            (optional)
+        :type ex_volume_type: ``str``
+
         :return: The newly created volume.
         :rtype: :class:`StorageVolume`
         """
@@ -190,7 +195,7 @@ class OpenStackNodeDriver(NodeDriver, OpenStackDriverMixin):
             'display_name': name,
             'display_description': name,
             'size': size,
-            'volume_type': None,
+            'volume_type': ex_volume_type,
             'metadata': {
                 'contents': name,
             },


Mime
View raw message