Skip to content

Commit

Permalink
Fix validate logic for no model found (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
dtzar authored and eedorenko committed Nov 26, 2019
1 parent 6c56eee commit d4a7633
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions code/register/register_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,13 @@ def main():
if (validate):
try:
tag_name = 'BuildId'
get_model_by_tag(model_name, tag_name, build_id, exp.workspace)
print("Model was registered for this build.")
model = get_model_by_tag(
model_name, tag_name, build_id, exp.workspace)
if (model is not None):
print("Model was registered for this build.")
if (model is None):
print("Model was not registered for this run.")
sys.exit(1)
except Exception as e:
print(e)
print("Model was not registered for this run.")
Expand Down

0 comments on commit d4a7633

Please sign in to comment.