mirror of https://git.48k.eu/ogclient
parent
bf7eb1542d
commit
8fb8a0a66d
|
@ -97,6 +97,8 @@ def ogReduceFs(disk, part):
|
|||
"""
|
||||
partdev = get_partition_device(disk, part)
|
||||
fstype = get_filesystem_type(partdev)
|
||||
if fstype == "unknown":
|
||||
return -1
|
||||
|
||||
umount(partdev)
|
||||
if fstype == 'ext4':
|
||||
|
@ -117,6 +119,8 @@ def ogExtendFs(disk, part):
|
|||
"""
|
||||
partdev = get_partition_device(disk, part)
|
||||
fstype = get_filesystem_type(partdev)
|
||||
if fstype == "unknown":
|
||||
return -1
|
||||
|
||||
umount(partdev)
|
||||
if fstype == 'ext4':
|
||||
|
@ -198,7 +202,9 @@ def get_filesystem_type(partdev):
|
|||
cmd = shlex.split(f'blkid -o value -s TYPE {partdev}')
|
||||
proc = subprocess.run(cmd, stdout=PIPE, encoding='utf-8')
|
||||
if proc.returncode != 0:
|
||||
raise RuntimeError(f'Error getting filesystem from {partdev}')
|
||||
log.error(f'Error getting filesystem from {partdev}')
|
||||
return "unknown"
|
||||
|
||||
return proc.stdout.strip()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue