mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
Filter controller_node selection to online nodes (#11120)
This commit is contained in:
parent
471f47cd9e
commit
3fc63489f1
@ -151,7 +151,9 @@ class Instance(HasPolicyEditsMixin, BaseModel):
|
||||
|
||||
@staticmethod
|
||||
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):
|
||||
if self.last_seen is None:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user