summaryrefslogtreecommitdiff
path: root/buildscripts
diff options
context:
space:
mode:
authorRichard Kreuter <richard@10gen.com>2010-04-28 12:15:19 -0400
committerRichard Kreuter <richard@10gen.com>2010-04-28 12:15:19 -0400
commited9dabff0570d262509e1f6a654d7fd6e4b126f5 (patch)
treec91882ffe3906fb853f8821262273c8e7d3fc59f /buildscripts
parentbe8ca3a191b264d6fabfa5a586b526f266201cbd (diff)
downloadmongo-ed9dabff0570d262509e1f6a654d7fd6e4b126f5.tar.gz
Another EC2 timing issue.
Diffstat (limited to 'buildscripts')
-rw-r--r--buildscripts/mergerepositories.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/buildscripts/mergerepositories.py b/buildscripts/mergerepositories.py
index e08cd764e49..1e0472ffaa7 100644
--- a/buildscripts/mergerepositories.py
+++ b/buildscripts/mergerepositories.py
@@ -47,17 +47,17 @@ class ec2node(object):
print "waiting for node to spin up"
# Wait for EC2 to tell us the node is running.
while 1:
- ## XXX: it seems as if existing nodes' states don't get
- ## updated, so we poll EC2 until we get a RUNNING node
- ## with the desired id.
-
- #EC2Driver.list_nodes()
- #print self.node
- #if self.node.state == NodeState.PENDING:
- # time.sleep(10)
- #else:
- # break
- n=[n for n in EC2Driver.list_nodes() if (n.id==self.node.id)][0]
+ n=None
+ # EC2 sometimes takes a while to report a node.
+ for i in range(6):
+ nodes = [n for n in EC2Driver.list_nodes() if (n.id==self.node.id)]
+ if len(nodes)>0:
+ n=nodes[0]
+ break
+ else:
+ time.sleep(10)
+ if not n:
+ raise Exception("couldn't find node with id %s" % self.node.id)
if n.state == NodeState.PENDING:
time.sleep(10)
else: