mirror of
https://github.com/ansible/awx.git
synced 2026-03-06 03:01:06 -03:30
Deal with exceptions when running execution_node_health_check (#12733)
This commit is contained in:
@@ -234,7 +234,7 @@ def worker_info(node_name, work_type='ansible-runner'):
|
|||||||
else:
|
else:
|
||||||
error_list.append(details)
|
error_list.append(details)
|
||||||
|
|
||||||
except (ReceptorNodeNotFound, RuntimeError) as exc:
|
except Exception as exc:
|
||||||
error_list.append(str(exc))
|
error_list.append(str(exc))
|
||||||
|
|
||||||
# If we have a connection error, missing keys would be trivial consequence of that
|
# 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
|
return
|
||||||
|
|
||||||
if instance.node_type != 'execution':
|
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):
|
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)
|
data = worker_info(node)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user