mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
Deal with exceptions when running execution_node_health_check (#12733)
This commit is contained in:
parent
5051224781
commit
0465a10df5
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user