You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by pq...@apache.org on 2010/03/02 09:22:38 UTC
svn commit: r917913 - /incubator/libcloud/trunk/libcloud/base.py
Author: pquerna
Date: Tue Mar 2 08:22:38 2010
New Revision: 917913
URL: http://svn.apache.org/viewvc?rev=917913&view=rev
Log:
Move the time we sleep waiting for things to a single variable, and decrease it from 10 seconds to 3 seconds.
Modified:
incubator/libcloud/trunk/libcloud/base.py
Modified: incubator/libcloud/trunk/libcloud/base.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/base.py?rev=917913&r1=917912&r2=917913&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/base.py (original)
+++ incubator/libcloud/trunk/libcloud/base.py Tue Mar 2 08:22:38 2010
@@ -582,6 +582,7 @@
def deploy_node(self, **kwargs):
# TODO: support ssh keys
+ WAIT_PERIOD=3
password = None
if 'generates_password' not in self.features["create_node"]:
@@ -601,7 +602,7 @@
while time.time() < end:
# need to wait until we get a public IP address.
# TODO: there must be a better way of doing this
- time.sleep(10)
+ time.sleep(WAIT_PERIOD)
nodes = self.list_nodes()
nodes = filter(lambda n: n.uuid == node.uuid, nodes)
if len(nodes) == 0:
@@ -627,10 +628,10 @@
laste = e
except socket.error, e:
laste = e
- time.sleep(10)
+ time.sleep(WAIT_PERIOD)
if laste is not None:
raise e
-
+
n = kwargs["deploy"].run(node, client)
client.close()
return n