Fix bootstrap_repositories.py
This commit is contained in:
@ -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
|
Reference in New Issue
Block a user