1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fixes #4538 passing int params as required by boto (#18999)

This commit is contained in:
Kash 2016-12-09 19:39:02 +00:00 committed by Ryan Brown
parent 0e124c57c6
commit 6b1586748f

View file

@ -48,7 +48,7 @@ options:
type: int
containers:
description:
- A list of containers definitions
- A list of containers definitions
required: False
type: list of dicts with container definitions
volumes:
@ -138,8 +138,24 @@ class EcsTaskManager:
return None
def register_task(self, family, container_definitions, volumes):
validated_containers = []
# Ensures the number parameters are int as required by boto
for container in container_definitions:
for param in ('memory', 'cpu', 'memoryReservation'):
if param in container:
container[param] = int(container[param])
if 'portMappings' in container:
for port_mapping in container['portMappings']:
for port in ('hostPort', 'containerPort'):
if port in port_mapping:
port_mapping[port] = int(port_mapping[port])
validated_containers.append(container)
response = self.ecs.register_task_definition(family=family,
containerDefinitions=container_definitions, volumes=volumes)
containerDefinitions=validated_containers, volumes=volumes)
return response['taskDefinition']
def describe_task_definitions(self, family):