Skip to content
Snippets Groups Projects
Commit 7ee45a2e authored by sguazt's avatar sguazt
Browse files

AWS: code clean-up

parent 82ec5812
No related branches found
No related tags found
No related merge requests found
......@@ -106,26 +106,11 @@ class AWSInstance(Instance):
#TODO: call "AWSEC2Utils.wait_for_operation(self._ec_conn, 'instance_running', [self._ec2_inst['InstanceId'])" to perform a synchronous version of this method
return True # Boto3 will raise an exception if an operation fails (see: https://boto3.amazonaws.com/v1/documentation/api/latest/guide/error-handling.html)
def _wait_for_operation(self, op):
""" Wait for the given operation to complete.
Args:
operation (str): the operation Id to wait for.
See:
- https://boto3.amazonaws.com/v1/documentation/api/latest/guide/clients.html
- https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2.html#waiters
"""
# See:
# - https://boto3.amazonaws.com/v1/documentation/api/latest/guide/clients.html
# - https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2.html#waiters
waiter = self.ec2_client.get_waiter(op)
waiter.wait(Filters=[
{'Name': 'instance-id', 'Values': [each_instance.instance_id]}])
d
# For a list of valid filters to use with the ex_filter parameter of certain methods,
# please visit https://docs.aws.amazon.com/en_us/AWSEC2/latest/APIReference/API_Operations.html
class AWS(MetaManager):
"""
EasyCloud Amazon Web Services Manager
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment