mirror of
https://github.com/ansible/awx.git
synced 2026-05-02 23:25:29 -02:30
don't allow isolated instances in IG.policy_instance_list
see: https://github.com/ansible/tower/issues/2394
This commit is contained in:
@@ -4696,6 +4696,8 @@ class InstanceGroupSerializer(BaseSerializer):
|
||||
raise serializers.ValidationError(_('Duplicate entry {}.').format(instance_name))
|
||||
if not Instance.objects.filter(hostname=instance_name).exists():
|
||||
raise serializers.ValidationError(_('{} is not a valid hostname of an existing instance.').format(instance_name))
|
||||
if Instance.objects.get(hostname=instance_name).is_isolated():
|
||||
raise serializers.ValidationError(_('Isolated instances may not be added or removed from instances groups via the API.'))
|
||||
return value
|
||||
|
||||
def validate_name(self, value):
|
||||
|
||||
Reference in New Issue
Block a user