updated to error if finished not in result

This commit is contained in:
sean-m-sullivan
2020-08-28 07:35:13 -05:00
parent 007b0d841e
commit d971375907

View File

@@ -594,6 +594,10 @@ class TowerAPIModule(TowerModule):
# Grab our start time to compare against for the timeout # Grab our start time to compare against for the timeout
start = time.time() start = time.time()
result = self.get_endpoint(url) result = self.get_endpoint(url)
if result['json']['finished'] is None:
self.json_output['msg'] = 'Monitoring of {0} "{1}" aborted due to timeout'.format(object_type, object_name)
self.fail_json(**self.json_output)
else:
while not result['json']['finished']: while not result['json']['finished']:
# If we are past our time out fail with a message # If we are past our time out fail with a message
if timeout and timeout < time.time() - start: if timeout and timeout < time.time() - start: