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")
|
||||
usage = "0%"
|
||||
try:
|
||||
usage = to_string(subprocess.check_output("df -h /mnt/hdd | grep /dev | awk '{print $5}'", shell=True))
|
||||
update_cached_data("data_drive_usage", usage)
|
||||
if is_mynode_drive_mounted():
|
||||
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:
|
||||
return usage
|
||||
return usage
|
||||
|
|
Loading…
Reference in New Issue
Block a user