prompt: handle timeout around btrfs

This commit is contained in:
Martin Sekera 2021-02-28 01:06:28 +01:00
parent eedbc09193
commit 7bfa0deecd

View file

@ -642,6 +642,7 @@ class StatsPart(Part):
continue
btrfs_encountered_devices.add(device)
try:
btrfs_raw = command(["/sbin/btrfs", "fi", "usage", "-b", dir])
for line in btrfs_raw.split("\n"):
@ -650,6 +651,9 @@ class StatsPart(Part):
elif "Free" in line:
stor_free = int(line.split()[-3])
break
except subprocess.TimeoutExpired:
stor_total = 1
stor_free = 0
else:
try: