Boto error_code is a string, not the HTTP status code

This commit is contained in:
Joseph Schorr 2015-12-23 15:12:01 -05:00
parent d6fd9a07c2
commit 5262535945

View file

@ -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