1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-27 00:55:06 +03:00

Placeholder FIXMEs for things of concern

This commit is contained in:
Jeff Bradberry 2024-01-25 10:30:33 -05:00 committed by Seth Foster
parent 957ce59bf7
commit 05502c0af8
2 changed files with 3 additions and 0 deletions

View File

@ -5640,6 +5640,7 @@ class InstanceSerializer(BaseSerializer):
def get_reverse_peers(self, obj):
return Instance.objects.prefetch_related('peers').filter(peers__in=obj.receptor_addresses.all()).values_list('id', flat=True)
# FIXME: protocol should be blank, null, or missing if there is no canonical address
def get_protocol(self, obj):
# note: don't create a different query for receptor addresses, as this is prefetched on the View for optimization
for addr in obj.receptor_addresses.all():

View File

@ -522,11 +522,13 @@ def receptor_address_saved(sender, instance, **kwargs):
control_instances = set(Instance.objects.filter(node_type__in=[Instance.Types.CONTROL, Instance.Types.HYBRID]))
if address.peers_from_control_nodes:
# FIXME: you ought to be able to have more connections than just the control instances
if set(address.peers_from.all()) != control_instances:
with disable_activity_stream():
address.peers_from.add(*control_instances)
schedule_write_receptor_config()
else:
# FIXME: you shouldn't unconditionally remove every peer when disabling peers_from_control_nodes
if address.peers_from.exists():
with disable_activity_stream():
address.peers_from.remove(*control_instances)