libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject [3/3] libcloud git commit: Added cloud specific parameter to base compute wait_until_running method to make compatible with Azure
Date Fri, 07 Aug 2015 21:29:40 GMT
Added cloud specific parameter to base compute wait_until_running method to make compatible
with Azure

Closes #548

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/4cc3adfe
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/4cc3adfe
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/4cc3adfe

Branch: refs/heads/trunk
Commit: 4cc3adfef808f175647832f5a4175fcd7e105eba
Parents: 4ab231c
Author: dwilson2038 <david.wilson2038@gmail.com>
Authored: Fri Jul 17 14:16:29 2015 +0000
Committer: Tomaz Muraus <tomaz@tomaz.me>
Committed: Fri Aug 7 23:23:52 2015 +0200

----------------------------------------------------------------------
 CHANGES.rst              |  7 +++++++
 libcloud/compute/base.py | 14 +++++++++++---
 2 files changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/4cc3adfe/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index 1747320..e9ea207 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -263,6 +263,13 @@ Compute
   (LIBCLOUD-731, GITHUB-559)
   [David Wilson]
 
+- Allow user to specify which arguments are passed to ``list_nodes`` method
+  which is called inside ``wait_until_running`` by passing
+  ``ex_list_nodes_kwargs`` argument to the ``wait_until_running`` method.
+  (``ex_user_data`` argument).
+  (LIBCLOUD-723, GITHUB-548)
+  [David Wilson]
+
 Storage
 ~~~~~~~
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/4cc3adfe/libcloud/compute/base.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/base.py b/libcloud/compute/base.py
index 7c9066c..c1b5bda 100644
--- a/libcloud/compute/base.py
+++ b/libcloud/compute/base.py
@@ -1260,8 +1260,9 @@ class NodeDriver(BaseDriver):
         raise NotImplementedError(
             'delete_key_pair not implemented for this driver')
 
-    def wait_until_running(self, nodes, wait_period=3, timeout=600,
-                           ssh_interface='public_ips', force_ipv4=True):
+    def wait_until_running(self, nodes, wait_period=3,
+                           timeout=600, ssh_interface='public_ips',
+                           force_ipv4=True, ex_list_nodes_kwargs=None):
         """
         Block until the provided nodes are considered running.
 
@@ -1287,10 +1288,17 @@ class NodeDriver(BaseDriver):
         :param force_ipv4: Ignore IPv6 addresses (default is True).
         :type force_ipv4: ``bool``
 
+        :param ex_list_nodes_kwargs: Optional driver-specific keyword arguments
+                                     which are passed to the ``list_nodes``
+                                     method.
+        :type ex_list_nodes_kwargs: ``dict``
+
         :return: ``[(Node, ip_addresses)]`` list of tuple of Node instance and
                  list of ip_address on success.
         :rtype: ``list`` of ``tuple``
         """
+        ex_list_nodes_kwargs = ex_list_nodes_kwargs or {}
+
         def is_supported(address):
             """
             Return True for supported address.
@@ -1316,7 +1324,7 @@ class NodeDriver(BaseDriver):
         uuids = set([node.uuid for node in nodes])
 
         while time.time() < end:
-            all_nodes = self.list_nodes()
+            all_nodes = self.list_nodes(**ex_list_nodes_kwargs)
             matching_nodes = list([node for node in all_nodes
                                    if node.uuid in uuids])
 


Mime
View raw message