Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
fixes #402. Add a delay to give EC2 time to stabilize on the existenc…
Browse files Browse the repository at this point in the history
…e of a new instance before we try to update the instance's status.
  • Loading branch information
walsh159 committed Jun 30, 2010
1 parent baaeee3 commit 5799638
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions boto/manage/server.py
Expand Up @@ -321,6 +321,9 @@ def create(cls, config_file=None, logical_volume = None, cfg = None, **params):
if elastic_ip != None and instances.__len__() > 0:
instance = instances[0]
print 'Waiting for instance to start so we can set its elastic IP address...'
# Sometimes we get a message from ec2 that says that the instance does not exist.
# Hopefully the following delay will giv eec2 enough time to get to a stable state:
time.sleep(5)
while instance.update() != 'running':
time.sleep(1)
instance.use_ip(elastic_ip)
Expand Down

0 comments on commit 5799638

Please sign in to comment.