Skip to content

Commit

Permalink
[#345] Fix model selector
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillmakhonin authored and Aleksandr Blatov committed Oct 8, 2018
1 parent dd0586c commit 58cac7a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions legion/legion/k8s/enclave.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,13 @@ def get_models_strict(self, model_id, model_version=None, ignore_not_found=False
"""
model_services = self.get_models(model_id, model_version)

if len(model_services) > 1 and not model_version:
raise Exception('Please specify version of model')
ignore_strictness = model_id == '*' or model_version == '*'

if len(model_services) > 1:
LOGGER.info('More than one model was found for filter: id={!r} version={!r}'
.format(model_id, model_version))
if not ignore_strictness and not model_version:
raise Exception('Please specify version of model')

if not model_services:
if not ignore_not_found:
Expand Down

0 comments on commit 58cac7a

Please sign in to comment.