Skip to content

Commit

Permalink
Delete disk in encrypteddisk table once it is offline'd
Browse files Browse the repository at this point in the history
  • Loading branch information
william-gr committed Jun 14, 2013
1 parent fa64e37 commit 3bd004c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gui/middleware/notifier.py
Expand Up @@ -1716,6 +1716,7 @@ def zfs_replace_disk(self, volume, from_label, to_disk, passphrase=None):
return ret

def zfs_offline_disk(self, volume, label):
from freenasUI.storage.models import EncryptedDisk

assert volume.vol_fstype == 'ZFS'

Expand All @@ -1735,6 +1736,10 @@ def zfs_offline_disk(self, volume, label):
raise MiddlewareError('Disk offline failed: "%s"' % error)
if label.endswith(".eli"):
self.__system("/sbin/geli detach /dev/%s" % label)
EncryptedDisk.objects.filter(
encrypted_volume=volume,
encrypted_provider=label[:-4]
).delete()

def zfs_detach_disk(self, volume, label):
"""Detach a disk from zpool
Expand Down

0 comments on commit 3bd004c

Please sign in to comment.