Boto error_code is a string, not the HTTP status code
This commit is contained in:
parent
d6fd9a07c2
commit
5262535945
1 changed files with 2 additions and 2 deletions
|
@ -161,7 +161,7 @@ class EC2Executor(BuilderExecutor):
|
|||
'BuildUUID': build_uuid,
|
||||
}))
|
||||
except boto.exception.EC2ResponseError as ec2e:
|
||||
if ec2e.error_code == 404:
|
||||
if ec2e.error_code == 'InvalidInstanceID.NotFound':
|
||||
if i < _TAG_RETRY_COUNT - 1:
|
||||
logger.warning('Failed to write EC2 tags (attempt #%s)', i)
|
||||
yield From(trollius.sleep(_TAG_RETRY_SLEEP))
|
||||
|
@ -179,7 +179,7 @@ class EC2Executor(BuilderExecutor):
|
|||
ec2_conn = self._get_conn()
|
||||
terminated_instances = yield From(ec2_conn.terminate_instances([builder_id]))
|
||||
except boto.exception.EC2ResponseError as ec2e:
|
||||
if ec2e.error_code == 404:
|
||||
if ec2e.error_code == 'InvalidInstanceID.NotFound':
|
||||
logger.debug('Instance %s already terminated', builder_id)
|
||||
return
|
||||
|
||||
|
|
Reference in a new issue