This repository has been archived by the owner on Oct 19, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ignore exception if instance doesn't exist in terminate
Sometimes EC2 failed to create an instance, the instance can't be available. Problem occurred if our code tries to terminate the instance. Traceback (most recent call last): File "/usr/lib64/python2.7/atexit.py", line 24, in _run_exitfuncs func(*targs, **kargs) File "/usr/lib/python2.7/site-packages/avocado_ec2/ec2_wrapper.py", line 46, in clean_aws_resources_atexit instance.terminate() File "/usr/lib/python2.7/site-packages/boto3/resources/factory.py", line 455, in do_action response = action(self, *args, **kwargs) File "/usr/lib/python2.7/site-packages/boto3/resources/action.py", line 79, in __call__ response = getattr(parent.meta.client, operation_name)(**params) File "/usr/lib/python2.7/site-packages/botocore/client.py", line 310, in _api_call return self._make_api_call(operation_name, kwargs) File "/usr/lib/python2.7/site-packages/botocore/client.py", line 395, in _make_api_call raise ClientError(parsed_response, operation_name) ClientError: An error occurred (InvalidInstanceID.NotFound) when calling the TerminateInstances operation: The instance ID 'i-0d0210cadfabc6eba' does not exist Signed-off-by: Amos Kong <[email protected]>
- Loading branch information