Skip to content

Commit

Permalink
Fixing up condition
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnPreston committed Jun 6, 2023
1 parent d5d383b commit 0bdf594
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ecs_composex/ecs/service_scaling/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ def __init__(self, family: ComposeFamily):
if not keyisset("Range", configuration):
return
self.defined = True
self.scheduled_actions: list = set_else_none("ScheduledActions", configuration)
self.scheduled_actions: list = set_else_none(
"ScheduledActions", configuration, []
)
if self.replicas != ecs_params.SERVICE_COUNT.Default:
self.family.stack.Parameters.update(
{ecs_params.SERVICE_COUNT.title: self.replicas}
Expand Down Expand Up @@ -180,7 +182,7 @@ def add_target_scaling(self) -> None:
def add_scheduled_actions(self) -> None:
"""Sets the scheduled actions"""
if not self.scalable_target or (
self.scalable_target and not self.scheduled_actions
self.scalable_target and not self.scalable_target.scheduled_actions
):
LOG.debug(f"services.{self.family.name}.x-scaling - No ScheduledActions")
return
Expand Down

0 comments on commit 0bdf594

Please sign in to comment.