mirror of https://git.48k.eu/ogclient
utils: add umount_all function
Add utility function to unmount any mountpoint present in the /mnt folder. This function is a simplified version of the legacy bash function ogUnmountAll used in several operations.more_events
parent
803ba74510
commit
cf6f50e528
|
@ -69,6 +69,15 @@ def umount(target):
|
|||
return not proc.returncode
|
||||
|
||||
|
||||
def umount_all():
|
||||
"""
|
||||
Umounts all mountpoints present in the /mnt folder.
|
||||
"""
|
||||
for path in ['/mnt/'+child for child in os.listdir('/mnt/')]:
|
||||
if os.path.ismount(path):
|
||||
umount(path)
|
||||
|
||||
|
||||
def get_usedperc(mountpoint):
|
||||
"""
|
||||
Returns percetage of used filesystem as decimal number.
|
||||
|
|
Loading…
Reference in New Issue