Skip to content

Commit

Permalink
[#543] Add sorting list of models
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillmakhonin committed Oct 19, 2018
1 parent 00bb44b commit acc6855
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion legion/legion/k8s/enclave.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,12 @@ def get_models(self, model_id=None, model_version=None):
:type model_version: str or None
:return: list[:py:class:`legion.k8s.ModelService`] -- founded model services
"""
return [
items = [
model_service
for id_and_version, model_service in self.models.items()
if model_id in (id_and_version.id, '*', None) and model_version in (id_and_version.version, None, '*')
]
return sorted(items, key=lambda ms: '{}/{}'.format(ms.id, ms.version))

def get_models_strict(self, model_id, model_version=None, ignore_not_found=False):
"""
Expand Down

0 comments on commit acc6855

Please sign in to comment.