mirror of
https://github.com/ansible/awx.git
synced 2026-05-10 19:07:36 -02:30
Turn off the filtering of hop nodes from the Instance endpoints
except for the health check.
This commit is contained in:
@@ -365,14 +365,11 @@ class InstanceList(ListAPIView):
|
|||||||
serializer_class = serializers.InstanceSerializer
|
serializer_class = serializers.InstanceSerializer
|
||||||
search_fields = ('hostname',)
|
search_fields = ('hostname',)
|
||||||
|
|
||||||
def get_queryset(self):
|
|
||||||
return super().get_queryset().exclude(node_type='hop')
|
|
||||||
|
|
||||||
|
|
||||||
class InstanceDetail(RetrieveUpdateAPIView):
|
class InstanceDetail(RetrieveUpdateAPIView):
|
||||||
|
|
||||||
name = _("Instance Detail")
|
name = _("Instance Detail")
|
||||||
queryset = models.Instance.objects.exclude(node_type='hop')
|
model = models.Instance
|
||||||
serializer_class = serializers.InstanceSerializer
|
serializer_class = serializers.InstanceSerializer
|
||||||
|
|
||||||
def update(self, request, *args, **kwargs):
|
def update(self, request, *args, **kwargs):
|
||||||
@@ -418,10 +415,14 @@ class InstanceInstanceGroupsList(InstanceGroupMembershipMixin, SubListCreateAtta
|
|||||||
class InstanceHealthCheck(GenericAPIView):
|
class InstanceHealthCheck(GenericAPIView):
|
||||||
|
|
||||||
name = _('Instance Health Check')
|
name = _('Instance Health Check')
|
||||||
queryset = models.Instance.objects.exclude(node_type='hop')
|
model = models.Instance
|
||||||
serializer_class = serializers.InstanceHealthCheckSerializer
|
serializer_class = serializers.InstanceHealthCheckSerializer
|
||||||
permission_classes = (IsSystemAdminOrAuditor,)
|
permission_classes = (IsSystemAdminOrAuditor,)
|
||||||
|
|
||||||
|
def get_queryset(self):
|
||||||
|
# FIXME: For now, we don't have a good way of checking the health of a hop node.
|
||||||
|
return super().get_queryset().exclude(node_type='hop')
|
||||||
|
|
||||||
def get(self, request, *args, **kwargs):
|
def get(self, request, *args, **kwargs):
|
||||||
obj = self.get_object()
|
obj = self.get_object()
|
||||||
data = self.get_serializer(data=request.data).to_representation(obj)
|
data = self.get_serializer(data=request.data).to_representation(obj)
|
||||||
|
|||||||
Reference in New Issue
Block a user