ECS: Fixes to DescribeTaskDefinition and StopTask (#5910)

This commit is contained in:
Viren Nadkarni 2023-02-08 17:50:26 +05:30 committed by GitHub
parent 2ee5dcea63
commit 06baff01d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 7 deletions

View File

@ -16,7 +16,7 @@ class TaskDefinitionNotFoundException(JsonRESTError):
def __init__(self):
super().__init__(
error_type="ClientException",
message="The specified task definition does not exist.",
message="Unable to describe task definition.",
)

View File

@ -1414,11 +1414,14 @@ class EC2ContainerServiceBackend(BaseBackend):
for task in tasks.keys():
if task.endswith(task_id):
container_instance_arn = tasks[task].container_instance_arn
if container_instance_arn:
container_instance = self.container_instances[cluster.name][
container_instance_arn.split("/")[-1]
]
self.update_container_instance_resources(
container_instance, tasks[task].resource_requirements, removing=True
container_instance,
tasks[task].resource_requirements,
removing=True,
)
tasks[task].last_status = "STOPPED"
tasks[task].desired_status = "STOPPED"