forked from infra/otc-metadata
Add environment filter to services_by_category
This commit is contained in:
parent
c7487fc72e
commit
ed955c066f
@ -87,10 +87,13 @@ class Services(object):
|
|||||||
res.append(copy.deepcopy(cat))
|
res.append(copy.deepcopy(cat))
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def services_by_category(self, category):
|
def services_by_category(self, category, environment=None):
|
||||||
"""List services matching category"""
|
"""List services matching category"""
|
||||||
res = []
|
res = []
|
||||||
for srv in self.all_services:
|
for srv in self.all_services:
|
||||||
|
if environment:
|
||||||
|
if "environment" in srv and srv["environment"] != environment:
|
||||||
|
continue
|
||||||
if srv["service_category"] == category:
|
if srv["service_category"] == category:
|
||||||
res.append(copy.deepcopy(srv))
|
res.append(copy.deepcopy(srv))
|
||||||
return res
|
return res
|
||||||
|
Loading…
x
Reference in New Issue
Block a user