ECS: Fixes to DescribeTaskDefinition and StopTask (#5910)
This commit is contained in:
parent
2ee5dcea63
commit
06baff01d1
@ -16,7 +16,7 @@ class TaskDefinitionNotFoundException(JsonRESTError):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
error_type="ClientException",
|
error_type="ClientException",
|
||||||
message="The specified task definition does not exist.",
|
message="Unable to describe task definition.",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1414,11 +1414,14 @@ class EC2ContainerServiceBackend(BaseBackend):
|
|||||||
for task in tasks.keys():
|
for task in tasks.keys():
|
||||||
if task.endswith(task_id):
|
if task.endswith(task_id):
|
||||||
container_instance_arn = tasks[task].container_instance_arn
|
container_instance_arn = tasks[task].container_instance_arn
|
||||||
|
if container_instance_arn:
|
||||||
container_instance = self.container_instances[cluster.name][
|
container_instance = self.container_instances[cluster.name][
|
||||||
container_instance_arn.split("/")[-1]
|
container_instance_arn.split("/")[-1]
|
||||||
]
|
]
|
||||||
self.update_container_instance_resources(
|
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].last_status = "STOPPED"
|
||||||
tasks[task].desired_status = "STOPPED"
|
tasks[task].desired_status = "STOPPED"
|
||||||
|
Loading…
Reference in New Issue
Block a user