Return better value for data drive usage if drive not mounted
This commit is contained in:
parent
9c870f815a
commit
489019345c
|
@ -57,8 +57,11 @@ def get_data_drive_usage():
|
||||||
return get_cached_data("data_drive_usage")
|
return get_cached_data("data_drive_usage")
|
||||||
usage = "0%"
|
usage = "0%"
|
||||||
try:
|
try:
|
||||||
usage = to_string(subprocess.check_output("df -h /mnt/hdd | grep /dev | awk '{print $5}'", shell=True))
|
if is_mynode_drive_mounted():
|
||||||
update_cached_data("data_drive_usage", usage)
|
usage = to_string(subprocess.check_output("df -h /mnt/hdd | grep /dev | awk '{print $5}'", shell=True))
|
||||||
|
update_cached_data("data_drive_usage", usage)
|
||||||
|
else:
|
||||||
|
return "N/A"
|
||||||
except:
|
except:
|
||||||
return usage
|
return usage
|
||||||
return usage
|
return usage
|
||||||
|
|
Loading…
Reference in New Issue
Block a user