Skip to content

Commit

Permalink
update role for root pool if necessary.
Browse files Browse the repository at this point in the history
  • Loading branch information
schakrava committed Jan 30, 2016
1 parent fe7b260 commit b4c946a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/rockstor/storageadmin/views/disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@ def _update_disk_state():
if (Pool.objects.filter(name=d.label).exists()):
# update the disk db object's pool field accordingly.
dob.pool = Pool.objects.get(name=d.label)

#this is for backwards compatibility. root pools created
#before the pool.role migration need this. It can safely be
#removed a few versions after 3.8-11 or when we reset migrations.
if (d.root is True):
dob.pool.role = 'root'
dob.pool.save()
else: # this disk is not known to exist in any pool via it's label
dob.pool = None
# If no pool has yet been found with this disk's label in and
Expand Down

0 comments on commit b4c946a

Please sign in to comment.