mirror of
https://github.com/ansible/awx.git
synced 2026-01-10 15:32:07 -03:30
Prevent any edits to hop nodes
to retain the behavior that they had pre-mesh-scaling.
This commit is contained in:
parent
af8b5243a3
commit
b879cbc2ec
@ -4946,8 +4946,12 @@ class InstanceSerializer(BaseSerializer):
|
||||
return float("{0:.2f}".format(((float(obj.capacity) - float(obj.consumed_capacity)) / (float(obj.capacity))) * 100))
|
||||
|
||||
def validate(self, data):
|
||||
if not self.instance and not settings.IS_K8S:
|
||||
raise serializers.ValidationError("Can only create instances on Kubernetes or OpenShift.")
|
||||
if self.instance:
|
||||
if self.instance.node_type == Instance.Types.HOP:
|
||||
raise serializers.ValidationError("Hop node instances may not be changed.")
|
||||
else:
|
||||
if not settings.IS_K8S:
|
||||
raise serializers.ValidationError("Can only create instances on Kubernetes or OpenShift.")
|
||||
return data
|
||||
|
||||
def validate_node_type(self, value):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user