mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 01:57:35 -03:30
[hop node] update peer validation logic (#14132)
This commit is contained in:
parent
8f8462b38e
commit
80df31fc4e
@ -5491,7 +5491,7 @@ class InstanceSerializer(BaseSerializer):
|
||||
if peers_from_control_nodes and node_type not in (Instance.Types.EXECUTION, Instance.Types.HOP):
|
||||
raise serializers.ValidationError(_("peers_from_control_nodes can only be enabled for execution or hop nodes."))
|
||||
|
||||
if node_type in (Instance.Types.CONTROL):
|
||||
if node_type == Instance.Types.CONTROL:
|
||||
if self.instance and 'peers' in attrs and set(self.instance.peers.all()) != set(attrs['peers']):
|
||||
raise serializers.ValidationError(
|
||||
_("Setting peers manually for control nodes is not allowed. Enable peers_from_control_nodes on the hop and execution nodes instead.")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user