This commit is contained in:
Gode, Sebastian 2025-04-28 13:17:59 +00:00
parent a432d6f39f
commit 7381111202

View File

@ -418,18 +418,19 @@ class Services(object):
break break
return res return res
def all_services_with_categories(self, cloud_environment, environment): def all_services_by_categories(self, cloud_environment, environments):
"""Retrieve all services sorted by categories """Retrieve all services sorted by categories
""" """
res = self.service_categories res = self.service_categories
for i, category in enumerate(res): for i, category in enumerate(res):
res[i]["services"] = [] res[i]["services"] = []
for srv in self.all_services: for srv in self.all_services:
if environment and cloud_environment: if environments and cloud_environment:
cloud_environment_check = False cloud_environment_check = False
if srv["is_global"] is not True: if srv["is_global"] is not True:
for srv_cloud_environment in srv["cloud_environments"]: for srv_cloud_environment in srv["cloud_environments"]:
if srv_cloud_environment["name"] == cloud_environment: if srv_cloud_environment["name"] == cloud_environment:
for environment in environments:
if srv_cloud_environment["visibility"] == environment: if srv_cloud_environment["visibility"] == environment:
cloud_environment_check = True cloud_environment_check = True
else: else: