Skip to content

Commit

Permalink
Bug fix: Force positive expression validation result to be bool
Browse files Browse the repository at this point in the history
  • Loading branch information
ipspace committed Feb 11, 2024
1 parent ac169da commit 86d0c5a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions netsim/cli/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,12 +467,12 @@ def execute_validation_expression(
if OK is not None and not OK: # We have a real result (not skipped) that is not OK
p_test_fail(node.name,v_entry,topology)
test_result_count += 1
return OK
elif OK: # ... or we might have a positive result
log_progress(f'Validation succeeded on {node.name}',topology)
test_result_count += 1
test_pass_count += 1

return OK
return bool(OK)

"""
execute_validation_plugin:
Expand Down Expand Up @@ -588,6 +588,7 @@ def execute_validation_test(
elif OK is False: # But if we have a single failure ...
ret_value = False # ... set composite result to False (failure)

print(f'VALID RET VALUE {ret_value}')
if ret_value: # If we got to 'True'
p_test_pass(v_entry,topology) # ... declare Mission Accomplished

Expand Down

0 comments on commit 86d0c5a

Please sign in to comment.