Docs constraints new architecture
Reviewed-by: Tino Schreiber <tino.schreiber@t-systems.com> Co-authored-by: Sebastian Gode <sebastian.gode@telekom.de> Co-committed-by: Sebastian Gode <sebastian.gode@telekom.de>
This commit is contained in:
@ -13,7 +13,6 @@
|
||||
|
||||
import copy
|
||||
import warnings
|
||||
import json
|
||||
|
||||
import otc_metadata.data
|
||||
|
||||
@ -76,7 +75,7 @@ class Services(object):
|
||||
def all_docs(self):
|
||||
"Service Docs data listing."
|
||||
return copy.deepcopy(self._service_data["documents"])
|
||||
|
||||
|
||||
@property
|
||||
def all_repositories(self):
|
||||
"Service Repositories data listing."
|
||||
@ -283,7 +282,7 @@ class Services(object):
|
||||
if not service:
|
||||
warnings.warn("No Service defition of type %s" % (cat))
|
||||
continue
|
||||
|
||||
|
||||
for repositories in self.all_repositories:
|
||||
if repositories["service_type"] == service["service_type"]:
|
||||
res_doc = copy.deepcopy(doc)
|
||||
@ -386,7 +385,7 @@ 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
|
||||
|
||||
@ -417,7 +416,7 @@ class Services(object):
|
||||
res[i]["repositories"] = repositories["repositories"]
|
||||
break
|
||||
return res
|
||||
|
||||
|
||||
def all_services_by_categories(self, cloud_environment, environments):
|
||||
"""Retrieve all services sorted by categories
|
||||
"""
|
||||
@ -440,7 +439,7 @@ class Services(object):
|
||||
for i, category in enumerate(res):
|
||||
if category["name"] == srv["service_category"]:
|
||||
res[i]["services"].append(srv)
|
||||
|
||||
|
||||
# Sort services
|
||||
for category in res:
|
||||
category["services"].sort(key=lambda x: x.get("service_title", "").lower())
|
||||
@ -448,4 +447,4 @@ class Services(object):
|
||||
# Sort categories
|
||||
res.sort(key=lambda x: x.get("name", "").lower())
|
||||
|
||||
return res
|
||||
return res
|
||||
|
Reference in New Issue
Block a user