Skip to content

Commit

Permalink
Catching exception in the exception
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnPreston committed Jan 24, 2024
1 parent 86ad6ce commit 7f1b53a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ecs_composex/elbv2/elbv2_ecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,11 @@ def validate_props_and_service_definition(props, service):
raise ValueError(
f"Defined TargetGroup port {props['Port']} is not defined for {service.name}."
" Valid ports are",
[p["published"] for p in service.ports],
[
_port["published"]
for _port in service.ports
if keyisset("published", _port)
],
)
chosen_port = [p for p in service.ports if p["target"] == props["Port"]]
if (chosen_port[0]["protocol"] == "tcp" and props["Protocol"] not in valid_tcp) or (
Expand Down

0 comments on commit 7f1b53a

Please sign in to comment.