Skip to content

Commit

Permalink
Fix OST pool grow (whamcloud#2064)
Browse files Browse the repository at this point in the history
Different types of sets were compared to each other:
objects and strings:

    current set([<ManagedOst: fs-OST0000>]),
    new set([u'fs-OST0000', u'fs-OST0001']),
    add set([u'fs-OST0000', u'fs-OST0001']),
    remove set([<ManagedOst: fs-OST0000>]).

Make sure to compare strings only.

Signed-off-by: Igor Pashev <pashev.igor@gmail.com>
  • Loading branch information
ip1981 authored and beevans committed Aug 6, 2020
1 parent acd492a commit c8d4fcc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chroma_core/services/job_scheduler/job_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,7 @@ def update_ostpool(self, ostpool_data):
with self._lock:
ostpool = OstPool.objects.get(pk=ostpool_data["id"])

current = set(ostpool.osts.all())
current = set(ostpool.osts.values_list("name", flat=True).all())
to_add = newlist - current
to_remove = current - newlist

Expand Down

0 comments on commit c8d4fcc

Please sign in to comment.