Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmacedot committed Jul 2, 2024
1 parent 67ad758 commit cb6edd1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
9 changes: 3 additions & 6 deletions src/ecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand All @@ -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

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

Expand Down
6 changes: 2 additions & 4 deletions src/worker-deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down Expand Up @@ -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]:
Expand Down

0 comments on commit cb6edd1

Please sign in to comment.