mirror of
https://github.com/nicolargo/glances.git
synced 2024-11-28 05:42:57 +03:00
Correct issue #346 if drive is removed during the FS grab
This commit is contained in:
parent
8fcc70049d
commit
0a615b95f6
@ -106,7 +106,7 @@ mem_critical=90
|
||||
list_1_description=Dropbox
|
||||
list_1_regex=.*dropbox.*
|
||||
list_1_countmin=1
|
||||
list_1_command=dropbox status
|
||||
list_1_command=dropbox status | head -1
|
||||
list_2_description=Python programs
|
||||
list_2_regex=.*python.*
|
||||
list_3_description=Famous Xeyes
|
||||
|
@ -59,7 +59,12 @@ class glancesGrabFs:
|
||||
fs_current['fs_type'] = fs_stat[fs].fstype
|
||||
fs_current['mnt_point'] = fs_stat[fs].mountpoint
|
||||
# Grab the disk usage
|
||||
fs_usage = psutil.disk_usage(fs_current['mnt_point'])
|
||||
try:
|
||||
fs_usage = psutil.disk_usage(fs_current['mnt_point'])
|
||||
except OSError:
|
||||
# Correct issue #346
|
||||
# Disk is ejected during the command
|
||||
continue
|
||||
fs_current['size'] = fs_usage.total
|
||||
fs_current['used'] = fs_usage.used
|
||||
fs_current['avail'] = fs_usage.free
|
||||
|
Loading…
Reference in New Issue
Block a user