Converted partprobe call into a function.
This commit is contained in:
parent
6d2126a597
commit
c0bf44e0ae
|
|
@ -112,8 +112,8 @@ class BlockDevice:
|
|||
@property
|
||||
def partitions(self):
|
||||
from .filesystem import Partition
|
||||
SysCommand(['partprobe', self.path])
|
||||
|
||||
self.partprobe()
|
||||
result = SysCommand(['/usr/bin/lsblk', '-J', self.path])
|
||||
|
||||
if b'not a block device' in result:
|
||||
|
|
@ -202,6 +202,9 @@ class BlockDevice:
|
|||
info = space_info
|
||||
return info
|
||||
|
||||
def partprobe(self):
|
||||
SysCommand(['partprobe', self.path])
|
||||
|
||||
def has_partitions(self):
|
||||
return len(self.partitions)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue