mirror of
https://github.com/ZwareBear/awx.git
synced 2026-04-24 00:41:48 -05:00
disabled instance does not mean offline instance
* Disabling an instance is used to stop and instance from being the target of new jobs to run. * The instance should still perform it's heartbeat so that it isn't considered offline. * If the instance was allowed to go offline on an openshift cluster it would be deleted from the database.
This commit is contained in:
@@ -339,10 +339,7 @@ class InstanceDetail(RetrieveUpdateAPIView):
|
||||
r = super(InstanceDetail, self).update(request, *args, **kwargs)
|
||||
if status.is_success(r.status_code):
|
||||
obj = self.get_object()
|
||||
if obj.enabled:
|
||||
obj.refresh_capacity()
|
||||
else:
|
||||
obj.capacity = 0
|
||||
obj.refresh_capacity()
|
||||
obj.save()
|
||||
r.data = serializers.InstanceSerializer(obj, context=self.get_serializer_context()).to_representation(obj)
|
||||
return r
|
||||
|
||||
Reference in New Issue
Block a user