Add environment filter to services_by_category
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Gode, Sebastian <sebastian.gode@t-systems.com> Co-committed-by: Gode, Sebastian <sebastian.gode@t-systems.com>
This commit is contained in:
parent
c5736b6886
commit
e97a327999
@ -87,10 +87,13 @@ class Services(object):
|
||||
res.append(copy.deepcopy(cat))
|
||||
return res
|
||||
|
||||
def services_by_category(self, category):
|
||||
def services_by_category(self, category, environment=None):
|
||||
"""List services matching category"""
|
||||
res = []
|
||||
for srv in self.all_services:
|
||||
if environment:
|
||||
if "environment" in srv and srv["environment"] != environment:
|
||||
continue
|
||||
if srv["service_category"] == category:
|
||||
res.append(copy.deepcopy(srv))
|
||||
return res
|
||||
|
Loading…
x
Reference in New Issue
Block a user