You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2019/12/13 22:55:39 UTC

[libcloud] branch trunk updated (179d5ae -> 6eb16e8)

This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git.


    from 179d5ae  Add changelog entry.
     new 80680e9  Support disk_size parameter for create_node
     new 845a377  Add missing docstring.
     new 0a8a28f  Fix lint.
     new 6eb16e8  Add changelog entry.

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 CHANGES.rst                                              |  4 ++++
 libcloud/compute/drivers/gce.py                          | 12 ++++++++++--
 libcloud/test/compute/fixtures/gce/aggregated_disks.json |  2 +-
 libcloud/test/compute/test_gce.py                        |  9 +++++++++
 4 files changed, 24 insertions(+), 3 deletions(-)


[libcloud] 01/04: Support disk_size parameter for create_node

Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit 80680e9b5e20e7cc0aa312be8b48404e5073de3a
Author: Peter Yu <20...@users.noreply.github.com>
AuthorDate: Fri Dec 13 13:39:38 2019 -0500

    Support disk_size parameter for create_node
---
 libcloud/compute/drivers/gce.py                          | 8 ++++++--
 libcloud/test/compute/fixtures/gce/aggregated_disks.json | 2 +-
 libcloud/test/compute/test_gce.py                        | 9 +++++++++
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/libcloud/compute/drivers/gce.py b/libcloud/compute/drivers/gce.py
index fc0641f..1918df4 100644
--- a/libcloud/compute/drivers/gce.py
+++ b/libcloud/compute/drivers/gce.py
@@ -3994,7 +3994,8 @@ class GCENodeDriver(NodeDriver):
             ex_disks_gce_struct=None, ex_nic_gce_struct=None,
             ex_on_host_maintenance=None, ex_automatic_restart=None,
             ex_preemptible=None, ex_image_family=None, ex_labels=None,
-            ex_accelerator_type=None, ex_accelerator_count=None):
+            ex_accelerator_type=None, ex_accelerator_count=None,
+            ex_disk_size=None):
         """
         Create a new node and return a node object for the node.
 
@@ -4132,6 +4133,9 @@ class GCENodeDriver(NodeDriver):
                                         accelerators to attach to the node.
         :type     ex_accelerator_count: ``int`` or ``None``
 
+        :keyword  ex_disk_size: Specify size of the boot disk.
+                                Integer in gigabytes.
+        :type     ex_disk_size: ``int`` or ``None``
 
         :return:  A Node object for the new node.
         :rtype:   :class:`Node`
@@ -4201,7 +4205,7 @@ class GCENodeDriver(NodeDriver):
             ex_can_ip_forward, ex_disks_gce_struct, ex_nic_gce_struct,
             ex_on_host_maintenance, ex_automatic_restart, ex_preemptible,
             ex_subnetwork, ex_labels, ex_accelerator_type,
-            ex_accelerator_count)
+            ex_accelerator_count, ex_disk_size)
         self.connection.async_request(request, method='POST', data=node_data)
         return self.ex_get_node(name, location.name)
 
diff --git a/libcloud/test/compute/fixtures/gce/aggregated_disks.json b/libcloud/test/compute/fixtures/gce/aggregated_disks.json
index 06a7c6c..243bbb0 100644
--- a/libcloud/test/compute/fixtures/gce/aggregated_disks.json
+++ b/libcloud/test/compute/fixtures/gce/aggregated_disks.json
@@ -76,7 +76,7 @@
         "name": "node-name",
         "type": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/diskTypes/pd-standard",
         "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/disks/node-name",
-        "sizeGb": "10",
+        "sizeGb": "25",
         "sourceImage": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20131120",
         "sourceImageId": "17312518942796567788",
         "status": "READY",
diff --git a/libcloud/test/compute/test_gce.py b/libcloud/test/compute/test_gce.py
index 72e56b7..4f20347 100644
--- a/libcloud/test/compute/test_gce.py
+++ b/libcloud/test/compute/test_gce.py
@@ -1409,6 +1409,15 @@ class GCENodeDriverTest(GoogleTestCase, TestCaseMixin):
         self.assertRaises(ResourceExistsError, self.driver.create_node,
                           node_name, size, image, location='europe-west1-a')
 
+    def test_create_node_ex_disk_size(self):
+        node_name = 'node-name'
+        image = self.driver.ex_get_image('debian-7')
+        size = self.driver.ex_get_size('n1-standard-1')
+        ex_disk_size = 25
+        node = self.driver.create_node(node_name, size, image,
+                                       ex_disk_size=ex_disk_size)
+        self.assertEqual(node.extra['boot_disk'].size, str(ex_disk_size))
+
     def test_ex_create_multiple_nodes(self):
         base_name = 'lcnode'
         image = self.driver.ex_get_image('debian-7')


[libcloud] 02/04: Add missing docstring.

Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit 845a37766226f9068139ad12d5bc6314d98107cc
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Fri Dec 13 23:26:33 2019 +0100

    Add missing docstring.
---
 libcloud/compute/drivers/gce.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libcloud/compute/drivers/gce.py b/libcloud/compute/drivers/gce.py
index 1918df4..2fc284d 100644
--- a/libcloud/compute/drivers/gce.py
+++ b/libcloud/compute/drivers/gce.py
@@ -8281,6 +8281,10 @@ class GCENodeDriver(NodeDriver):
         :param  ex_accelerator_count: The number of accelerators to associate
                                       with the node.
         :type   ex_accelerator_count: ``int`` or ``None``
+        
+        :keyword  ex_disk_size: Specify size of the boot disk.
+                                Integer in gigabytes.
+        :type     ex_disk_size: ``int`` or ``None``
 
         :return:  A tuple containing a request string and a node_data dict.
         :rtype:   ``tuple`` of ``str`` and ``dict``


[libcloud] 03/04: Fix lint.

Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit 0a8a28f1dd37d3b04e666a7b59e0586a398ce0eb
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Fri Dec 13 23:53:07 2019 +0100

    Fix lint.
---
 libcloud/compute/drivers/gce.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libcloud/compute/drivers/gce.py b/libcloud/compute/drivers/gce.py
index 2fc284d..5422fbb 100644
--- a/libcloud/compute/drivers/gce.py
+++ b/libcloud/compute/drivers/gce.py
@@ -8281,7 +8281,7 @@ class GCENodeDriver(NodeDriver):
         :param  ex_accelerator_count: The number of accelerators to associate
                                       with the node.
         :type   ex_accelerator_count: ``int`` or ``None``
-        
+
         :keyword  ex_disk_size: Specify size of the boot disk.
                                 Integer in gigabytes.
         :type     ex_disk_size: ``int`` or ``None``


[libcloud] 04/04: Add changelog entry.

Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit 6eb16e80afee5653da618c37561b491892e390a6
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Fri Dec 13 23:54:05 2019 +0100

    Add changelog entry.
---
 CHANGES.rst | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/CHANGES.rst b/CHANGES.rst
index dd2f1ca..8d832f7 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -12,6 +12,10 @@ Compute
   volume name to the API. (GITHUB-1380)
   [@mpempekos]
 
+- [GCE] Add ``ex_disk_size`` argument to the ``create_node`` method.
+  (GITHUB-1386)
+  [Peter Yu - @yukw777]
+
 Storage
 -------