Fix bootstrap_repositories.py

This commit is contained in:
2025-04-14 09:39:37 +00:00
parent fdcbf4047f
commit f5bdf81d2d
2 changed files with 49 additions and 11 deletions

View File

@ -341,3 +341,34 @@ class Services(object):
break
break
return res
def get_service_with_repo_by_service_type(self, service_type):
"""Retrieve service with repos by service_type
:param str service_type: Filter by service_type
"""
res = dict()
res = {}
services = self.all_services
for service in services:
if service["service_type"] == service_type:
res = service
for repositories in self.all_repositories:
if repositories["service_type"] == service["service_type"]:
res["repositories"] = repositories["repositories"]
break
break
return res
def services_with_repos(self):
"""Retrieve all services with repos
"""
res = []
services = self.all_services
for i, service in enumerate(services):
res.append(service)
for repositories in self.all_repositories:
if repositories["service_type"] == service["service_type"]:
res[i]["repositories"] = repositories["repositories"]
break
return res