Add the status field to ECS task definitions (#3723)

Also I found extra tests for describe_task_definition and deregister_task_definition that were not being run,
so I changed their names so they are found by pytest and made them pass.  I also added checks to them for the new
status field.
This commit is contained in:
William Richard 2021-02-24 08:26:26 -05:00 committed by GitHub
commit 0f4f01bb7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 10 deletions

View file

@ -177,6 +177,7 @@ class TaskDefinition(BaseObject, CloudFormationModel):
self.cpu = cpu
self.memory = memory
self.status = "ACTIVE"
@property
def response_object(self):
@ -788,7 +789,9 @@ class EC2ContainerServiceBackend(BaseBackend):
family in self.task_definitions
and revision in self.task_definitions[family]
):
return self.task_definitions[family].pop(revision)
task_definition = self.task_definitions[family].pop(revision)
task_definition.status = "INACTIVE"
return task_definition
else:
raise TaskDefinitionNotFoundException