Permalink
Browse files

Expose ssh_interface in the deploy_node method. part of LIBCLOUD-198.

git-svn-id: https://svn.apache.org/repos/asf/libcloud/trunk@1339977 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent a95d810 commit a721cf8ba5c70885532093ed138bff1a33a74203 @Kami Kami committed May 18, 2012
Showing with 9 additions and 3 deletions.
  1. +1 −1 CHANGES
  2. +8 −2 libcloud/compute/base.py
View
@@ -10,7 +10,7 @@ Changes with Apache Libcloud in development:
- Add ex_register_iso method to the CloudStack driver. ; LIBCLOUD-196
[Daemian Mack]
- - Allow user to specify which IP to use when calling _wait_until_running.
+ - Allow user to specify which IP to use when calling deploy_node.
(defaults to 'public_ips'). Previously it only worked with public IP, now
user can pass 'private_ips' as an argument and SSH client will try to
connect to the node first private IP address.
View
@@ -529,6 +529,10 @@ def deploy_node(self, **kwargs):
before giving up (default is 3)
@type max_tries: C{int}
+ @keyword ssh_interface: The interface to wait for. Default is
+ 'public_ips', other option is 'private_ips'.
+ @type ssh_interface: C{str}
+
See L{NodeDriver.create_node} for more keyword args.
>>> from libcloud.compute.drivers.dummy import DummyNodeDriver
@@ -579,8 +583,10 @@ def deploy_node(self, **kwargs):
try:
# Wait until node is up and running and has IP assigned
- node, ip_addresses = self._wait_until_running(
- node=node, wait_period=3, timeout=NODE_ONLINE_WAIT_TIMEOUT)
+ ssh_interface = kwargs.get('ssh_interface', 'public_ips')
+ node, ip_addresses = self._wait_until_running(node=node,
+ wait_period=3, timeout=NODE_ONLINE_WAIT_TIMEOUT,
+ ssh_interface=ssh_interface)
if password:
node.extra['password'] = password

0 comments on commit a721cf8

Please sign in to comment.