mirror of
https://github.com/ansible/awx.git
synced 2026-05-10 02:47:36 -02:30
Filter controller_node selection to online nodes (#11120)
This commit is contained in:
@@ -151,7 +151,9 @@ class Instance(HasPolicyEditsMixin, BaseModel):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def choose_online_control_plane_node():
|
def choose_online_control_plane_node():
|
||||||
return random.choice(Instance.objects.filter(enabled=True).filter(node_type__in=['control', 'hybrid']).values_list('hostname', flat=True))
|
return random.choice(
|
||||||
|
Instance.objects.filter(enabled=True, capacity__gt=0).filter(node_type__in=['control', 'hybrid']).values_list('hostname', flat=True)
|
||||||
|
)
|
||||||
|
|
||||||
def is_lost(self, ref_time=None):
|
def is_lost(self, ref_time=None):
|
||||||
if self.last_seen is None:
|
if self.last_seen is None:
|
||||||
|
|||||||
Reference in New Issue
Block a user