Deal with exceptions when running execution_node_health_check (#12733)

This commit is contained in:
Jeff Bradberry 2022-08-24 15:36:35 -04:00
parent 5051224781
commit 0465a10df5
2 changed files with 5 additions and 3 deletions

View File

@ -234,7 +234,7 @@ def worker_info(node_name, work_type='ansible-runner'):
else:
error_list.append(details)
except (ReceptorNodeNotFound, RuntimeError) as exc:
except Exception as exc:
error_list.append(str(exc))
# If we have a connection error, missing keys would be trivial consequence of that

View File

@ -413,10 +413,12 @@ def execution_node_health_check(node):
return
if instance.node_type != 'execution':
raise RuntimeError(f'Execution node health check ran against {instance.node_type} node {instance.hostname}')
logger.warning(f'Execution node health check ran against {instance.node_type} node {instance.hostname}')
return
if instance.node_state not in (Instance.States.READY, Instance.States.UNAVAILABLE, Instance.States.INSTALLED):
raise RuntimeError(f"Execution node health check ran against node {instance.hostname} in state {instance.node_state}")
logger.warning(f"Execution node health check ran against node {instance.hostname} in state {instance.node_state}")
return
data = worker_info(node)