Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Commit

Permalink
Fix indeterministic worker filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
dralley committed May 22, 2018
1 parent 33f93ea commit d62bf5a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pulpcore/pulpcore/app/viewsets/task.py
Expand Up @@ -78,17 +78,17 @@ def filter_online(self, queryset, name, value):
online_workers = Worker.objects.online_workers()

if value:
return queryset.intersection(online_workers)
return queryset.filter(pk__in=online_workers)
else:
return queryset.difference(online_workers)
return queryset.exclude(pk__in=online_workers)

def filter_missing(self, queryset, name, value):
missing_workers = Worker.objects.missing_workers()

if value:
return queryset.intersection(missing_workers)
return queryset.filter(pk__in=missing_workers)
else:
return queryset.difference(missing_workers)
return queryset.exclude(pk__in=missing_workers)


class WorkerViewSet(NamedModelViewSet,
Expand Down

0 comments on commit d62bf5a

Please sign in to comment.