storage: Don't check type of the disk for / and /boot

Other types could be 'disk' (where there is no partition table) and 'loop' when
the disk is a loop back device. As long as they are mounted on a important
folders, don't let user unmount them.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Sunil Mohan Adapa 2019-03-28 13:51:00 -07:00
parent 6c28884995
commit 6c86db132b
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2

View File

@ -174,12 +174,12 @@ def is_removable_device(disk):
def is_root_partition(disk):
"""Returns whether this disk is mounted at /."""
return disk['mountpoint'] == '/' and disk['type'] == 'part'
return disk['mountpoint'] == '/'
def is_boot_partition(disk):
"""Returns whether this disk is mounted at /boot."""
return disk['mountpoint'] == '/boot' and disk['type'] == 'part'
return disk['mountpoint'] == '/boot'
def is_expandable(device):