mirror of
https://github.com/certbot/certbot.git
synced 2026-06-04 14:26:10 -04:00
Retry in case of ephemeral errors
This commit is contained in:
parent
122a36ebd2
commit
b8281fdd34
1 changed files with 9 additions and 1 deletions
|
|
@ -139,7 +139,15 @@ def make_instance(instance_name,
|
|||
time.sleep(1.0)
|
||||
|
||||
# give instance a name
|
||||
new_instance.create_tags(Tags=[{'Key': 'Name', 'Value': instance_name}])
|
||||
try:
|
||||
new_instance.create_tags(Tags=[{'Key': 'Name', 'Value': instance_name}])
|
||||
except botocore.exceptions.ClientError, e:
|
||||
if "InvalidInstanceID.NotFound" in str(e):
|
||||
# This seems to be ephemeral... retry
|
||||
time.sleep(1)
|
||||
new_instance.create_tags(Tags=[{'Key': 'Name', 'Value': instance_name}])
|
||||
else:
|
||||
raise
|
||||
return new_instance
|
||||
|
||||
def terminate_and_clean(instances):
|
||||
|
|
|
|||
Loading…
Reference in a new issue