Handle the case where we cannot write the tags on the build nodes

This commit is contained in:
Joseph Schorr 2015-02-25 13:47:36 -05:00
parent 258588b914
commit 2eaec092f0

View file

@ -143,12 +143,18 @@ class EC2Executor(BuilderExecutor):
raise ExecutorException('EC2 started wrong number of instances!')
launched = AsyncWrapper(reservation.instances[0])
yield From(launched.add_tags({
'Name': 'Quay Ephemeral Builder',
'Realm': realm,
'Token': token,
'BuildUUID': build_uuid,
}))
for i in range(0, 2):
try:
yield From(launched.add_tags({
'Name': 'Quay Ephemeral Builder',
'Realm': realm,
'Token': token,
'BuildUUID': build_uuid,
}))
except boto.exception.EC2ResponseError:
logger.exception('Failed to write EC2 tags (attempt #%s)', i)
raise Return(launched.id)
@coroutine