Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
Signed-off-by: Alina Buzachis <[email protected]>
  • Loading branch information
alinabuzachis committed Jun 1, 2022
1 parent f71953a commit 090593e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions aws/terminator/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ def terminate(self):
self.client.cancel_spot_instance_requests(SpotInstanceRequestIds=[self.id])


class Ecs(Terminator):
class Ecs(DbTerminator):
@property
def age_limit(self):
return datetime.timedelta(minutes=20)
Expand Down Expand Up @@ -692,32 +692,32 @@ def _paginate_service_results():
tasks = _paginate_task_results(name['containerInstanceArn'])
for task in tasks:
self.client.stop_task(cluster=self.name, task=task['taskArn'])

# If there are running services, delete them first
services = _paginate_service_results()
for name in services:
self.client.delete_service(cluster=self.name, service=name['serviceName'], force=True)

# Deregister container instances
for name in container_instances:
self.client.deregister_container_instance(containerInstance=name['containerInstanceArn'])

# Delete cluster
try:
self.client.delete_cluster(cluster=self.name)
except (botocore.exceptions.ClusterContainsServicesException, botocore.exceptions.ClusterContainsTasksException):
except (self.client.exceptions.ClusterContainsServicesException, self.client.exceptions.ClusterContainsTasksException):
pass


class EcsCluster(Terminator):
class EcsCluster(DbTerminator):
@property
def age_limit(self):
return datetime.timedelta(minutes=30)

@property
def name(self):
return self.instance['clusterName']

@staticmethod
def create(credentials):
def _paginate_cluster_results(client):
Expand Down

0 comments on commit 090593e

Please sign in to comment.