diff --git a/otc_metadata/services.py b/otc_metadata/services.py index 7d32dde..693042d 100644 --- a/otc_metadata/services.py +++ b/otc_metadata/services.py @@ -418,20 +418,21 @@ class Services(object): break 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 """ res = self.service_categories for i, category in enumerate(res): res[i]["services"] = [] for srv in self.all_services: - if environment and cloud_environment: + if environments and cloud_environment: cloud_environment_check = False if srv["is_global"] is not True: for srv_cloud_environment in srv["cloud_environments"]: if srv_cloud_environment["name"] == cloud_environment: - if srv_cloud_environment["visibility"] == environment: - cloud_environment_check = True + for environment in environments: + if srv_cloud_environment["visibility"] == environment: + cloud_environment_check = True else: continue if cloud_environment_check is False: