Disk plugin: return immediately if usage fails

closes #1297
This commit is contained in:
Cameron Sparr
2016-05-31 16:58:41 +01:00
parent c4cfdb8a25
commit 0aff7a0bc1
2 changed files with 2 additions and 1 deletions

View File

@@ -84,10 +84,10 @@ func (s *systemPS) DiskUsage(
mountpoint := os.Getenv("HOST_MOUNT_PREFIX") + p.Mountpoint
if _, err := os.Stat(mountpoint); err == nil {
du, err := disk.Usage(mountpoint)
du.Path = p.Mountpoint
if err != nil {
return nil, err
}
du.Path = p.Mountpoint
// If the mount point is a member of the exclude set,
// don't gather info on it.
_, ok := fstypeExcludeSet[p.Fstype]