prompt: handle timeout around btrfs
This commit is contained in:
parent
eedbc09193
commit
7bfa0deecd
1 changed files with 12 additions and 8 deletions
|
@ -642,14 +642,18 @@ class StatsPart(Part):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
btrfs_encountered_devices.add(device)
|
btrfs_encountered_devices.add(device)
|
||||||
btrfs_raw = command(["/sbin/btrfs", "fi", "usage", "-b", dir])
|
try:
|
||||||
|
btrfs_raw = command(["/sbin/btrfs", "fi", "usage", "-b", dir])
|
||||||
|
|
||||||
for line in btrfs_raw.split("\n"):
|
for line in btrfs_raw.split("\n"):
|
||||||
if "Device size" in line:
|
if "Device size" in line:
|
||||||
stor_total = int(line.split()[-1])
|
stor_total = int(line.split()[-1])
|
||||||
elif "Free" in line:
|
elif "Free" in line:
|
||||||
stor_free = int(line.split()[-3])
|
stor_free = int(line.split()[-3])
|
||||||
break
|
break
|
||||||
|
except subprocess.TimeoutExpired:
|
||||||
|
stor_total = 1
|
||||||
|
stor_free = 0
|
||||||
|
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue