summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Bradberry <jeff.bradberry@gmail.com>2024-01-25 16:30:33 +0100
committerSeth Foster <fosterseth@users.noreply.github.com>2024-02-02 16:37:41 +0100
commit05502c0af80bcf048aa6c25f83681c71e5792d0a (patch)
tree0f27535e00e713e3887175d4731435f2aae3e1ae
parentUse Counter to find duplicate peer relationships (diff)
downloadawx-05502c0af80bcf048aa6c25f83681c71e5792d0a.tar.xz
awx-05502c0af80bcf048aa6c25f83681c71e5792d0a.zip
Placeholder FIXMEs for things of concern
-rw-r--r--awx/api/serializers.py1
-rw-r--r--awx/main/models/ha.py2
2 files changed, 3 insertions, 0 deletions
diff --git a/awx/api/serializers.py b/awx/api/serializers.py
index e32016a6c4..e7a89f8e58 100644
--- a/awx/api/serializers.py
+++ b/awx/api/serializers.py
@@ -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():
diff --git a/awx/main/models/ha.py b/awx/main/models/ha.py
index 2c237fbefd..5aec708c07 100644
--- a/awx/main/models/ha.py
+++ b/awx/main/models/ha.py
@@ -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)