From cb6edd1dfcc836ba52dfc71ad67131ff2bb157c2 Mon Sep 17 00:00:00 2001 From: lucasmacedot Date: Mon, 1 Jul 2024 22:59:39 -0400 Subject: [PATCH] Lint --- src/ecs.py | 9 +++------ src/worker-deploy.py | 6 ++---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/ecs.py b/src/ecs.py index 6d73017..810543d 100755 --- a/src/ecs.py +++ b/src/ecs.py @@ -24,8 +24,7 @@ def update_service( ) def describe_services(self, cluster_name, app_name): - result = self.boto.describe_services( - cluster=cluster_name, services=[app_name]) + result = self.boto.describe_services(cluster=cluster_name, services=[app_name]) if "taskSets" in result["services"][0]: for taskSet in result["services"][0]["taskSets"]: @@ -45,8 +44,7 @@ def register_task_definition(self, task_definition): return result def describe_task_definition(self, task_definition): - result = self.boto.describe_task_definition( - taskDefinition=task_definition) + result = self.boto.describe_task_definition(taskDefinition=task_definition) self.taskDefArn = result["taskDefinition"]["taskDefinitionArn"] return result @@ -56,8 +54,7 @@ def list_tasks(self, cluster_name: str, started_by, desired_status="STOPPED"): ) def describe_tasks(self, cluster_name: str, task_arns): - result = self.boto.describe_tasks( - cluster=cluster_name, tasks=task_arns) + result = self.boto.describe_tasks(cluster=cluster_name, tasks=task_arns) self.status = result["tasks"][0]["lastStatus"] return result diff --git a/src/worker-deploy.py b/src/worker-deploy.py index 8deefa4..4afb3d3 100755 --- a/src/worker-deploy.py +++ b/src/worker-deploy.py @@ -68,8 +68,7 @@ ) ecs_deploy = list( - filter(lambda x: x["status"] == "PRIMARY", - deployment["services"][0]["deployments"]) + filter(lambda x: x["status"] == "PRIMARY", deployment["services"][0]["deployments"]) ) ecs_deploy_status = ecs_deploy[0]["rolloutState"] @@ -99,8 +98,7 @@ def rollback(): # Check if containers are being stoped last_task = task.list_tasks(cluster_name, task.ecsDeployId) if len(last_task["taskArns"]) > 2: - last_task_info = task.describe_tasks( - cluster_name, last_task["taskArns"]) + last_task_info = task.describe_tasks(cluster_name, last_task["taskArns"]) last_task_status = last_task_info["tasks"][0]["lastStatus"] last_task_reason = last_task_info["tasks"][0]["stoppedReason"] if "reason" in last_task_info["tasks"][0]["containers"][0]: