Skip to content

Commit

Permalink
Fix single-container unset settings on __init__
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnPreston committed Nov 29, 2023
1 parent 89f8292 commit f71b56b
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions ecs_composex/ecs/ecs_family/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

from ecs_composex.common.logging import LOG
from ecs_composex.common.stacks import ComposeXStack
from ecs_composex.common.troposphere_tools import Parameter
from ecs_composex.common.troposphere_tools import Parameter, add_outputs, add_parameters
from ecs_composex.compose.compose_services import ComposeService
from ecs_composex.ecs import ecs_conditions, ecs_params
from ecs_composex.ecs.ecs_family.family_helpers import (
Expand All @@ -41,12 +41,14 @@
from ecs_composex.ecs.managed_sidecars.aws_xray import set_xray
from ecs_composex.ecs.service_compute import ServiceCompute
from ecs_composex.ecs.service_networking import ServiceNetworking
from ecs_composex.ecs.service_networking.helpers import update_family_subnets
from ecs_composex.ecs.service_networking.helpers import (
set_family_hostname,
update_family_subnets,
)
from ecs_composex.ecs.service_scaling import ServiceScaling
from ecs_composex.ecs.task_compute import TaskCompute
from ecs_composex.ecs.task_iam import TaskIam

from ...common.troposphere_tools import add_outputs, add_parameters
from .family_helpers import assign_secrets_to_roles, ensure_essential_containers
from .family_template import set_template
from .task_runtime import define_family_runtime_parameters
Expand Down Expand Up @@ -105,6 +107,9 @@ def __init__(self, services: list[ComposeService], family_name):
self.service_networking = None
self.task_compute = None
self.service_compute = ServiceCompute(self)
self.set_task_ephemeral_storage()
self.set_enable_execute_command()
set_family_hostname(self)

@property
def logical_name(self) -> str:
Expand Down Expand Up @@ -355,9 +360,6 @@ def add_service(self, service: ComposeService):
Function to add new services (defined in the compose files). Not to use for managed sidecars
:param ComposeService service:
"""
from ecs_composex.ecs.service_networking.helpers import set_family_hostname

from .task_execute_command import set_enable_execute_command

self._compose_services.append(service)

Expand All @@ -371,7 +373,7 @@ def add_service(self, service: ComposeService):
)
self.set_secrets_access()
self.set_task_ephemeral_storage()
set_enable_execute_command(self)
self.set_enable_execute_command()
set_family_hostname(self)

def add_managed_sidecar(self, service: ComposeService):
Expand Down

0 comments on commit f71b56b

Please sign in to comment.