mirror of
https://github.com/ansible/awx.git
synced 2026-07-04 04:48:02 -02:30
disabled instance does not mean offline instance
* Disabling an instance is used to stop and instance from being the target of new jobs to run. * The instance should still perform it's heartbeat so that it isn't considered offline. * If the instance was allowed to go offline on an openshift cluster it would be deleted from the database.
This commit is contained in:
@@ -396,14 +396,9 @@ def cluster_node_heartbeat():
|
||||
instance_list.remove(inst)
|
||||
if this_inst:
|
||||
startup_event = this_inst.is_lost(ref_time=nowtime)
|
||||
if this_inst.capacity == 0 and this_inst.enabled:
|
||||
logger.warning('Rejoining the cluster as instance {}.'.format(this_inst.hostname))
|
||||
if this_inst.enabled:
|
||||
this_inst.refresh_capacity()
|
||||
elif this_inst.capacity != 0 and not this_inst.enabled:
|
||||
this_inst.capacity = 0
|
||||
this_inst.save(update_fields=['capacity'])
|
||||
this_inst.refresh_capacity()
|
||||
if startup_event:
|
||||
logger.warning('Rejoining the cluster as instance {}.'.format(this_inst.hostname))
|
||||
return
|
||||
else:
|
||||
raise RuntimeError("Cluster Host Not Found: {}".format(settings.CLUSTER_HOST_ID))
|
||||
|
||||
Reference in New Issue
Block a user