From b922af8ab7c615316e46ccd9468c8fedbe946cfa Mon Sep 17 00:00:00 2001 From: Toshiya Kawasaki Date: Fri, 8 Sep 2017 03:28:56 +0900 Subject: [PATCH] set None to ecs taskdefinition volumes called when called from cfn (#1104) --- moto/ecs/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moto/ecs/models.py b/moto/ecs/models.py index d3ec2b7f7..bc847b32e 100644 --- a/moto/ecs/models.py +++ b/moto/ecs/models.py @@ -114,7 +114,7 @@ class TaskDefinition(BaseObject): family = properties.get( 'Family', 'task-definition-{0}'.format(int(random() * 10 ** 6))) container_definitions = properties['ContainerDefinitions'] - volumes = properties['Volumes'] + volumes = properties.get('Volumes') ecs_backend = ecs_backends[region_name] return ecs_backend.register_task_definition( @@ -127,7 +127,7 @@ class TaskDefinition(BaseObject): family = properties.get( 'Family', 'task-definition-{0}'.format(int(random() * 10 ** 6))) container_definitions = properties['ContainerDefinitions'] - volumes = properties['Volumes'] + volumes = properties.get('Volumes') if (original_resource.family != family or original_resource.container_definitions != container_definitions or original_resource.volumes != volumes):