Skip to content

Commit

Permalink
Fixed not being able to deal with service names
Browse files Browse the repository at this point in the history
  • Loading branch information
markotting committed Mar 18, 2024
1 parent eb16fcf commit d381118
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions plugins/modules/ecs_service_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,16 @@ def get_cluster_services(self):

cluster_services = {}
for cluster in clusters:
services = self.list_services(cluster)["services"]
service_arns = self.list_services(cluster)["services"]
if self.module.params["service"]:
services_found = [service for service in self.module.params["service"] if service in services]
service_names = [service.split("/")[-1] for service in service_arns]
services_found = []
for service in self.module.params["service"]:
if service in service_names or service in service_arns:
services_found.append(service)
cluster_services[cluster] = services_found
else:
cluster_services[cluster] = services
cluster_services[cluster] = service_arns
return cluster_services


Expand Down

0 comments on commit d381118

Please sign in to comment.