diff options
author | zheng <Zheng.chai@citrix.com> | 2015-05-19 12:33:28 +0100 |
---|---|---|
committer | zheng <Zheng.chai@citrix.com> | 2015-05-19 12:33:28 +0100 |
commit | fa78be4b463ee703c82c5b711520d3aa953ad846 (patch) | |
tree | 8eaf1ae94b0e458f36f634206183e2556e4f0b05 | |
parent | 2fb5afbd442e35a6e0ba3bd57a04e0bd58c7c213 (diff) | |
parent | b2204b0f93db38ea7f8eaa658d1bab4c49e78d79 (diff) | |
download | vyos-xe-guest-utilities-fa78be4b463ee703c82c5b711520d3aa953ad846.tar.gz vyos-xe-guest-utilities-fa78be4b463ee703c82c5b711520d3aa953ad846.zip |
Merge pull request #2 from xs-nanjing/master
CP-11399: Ignore blkid errors
-rw-r--r-- | guestmetric/guestmetric_linux.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/guestmetric/guestmetric_linux.go b/guestmetric/guestmetric_linux.go index 3970da4..19baeb6 100644 --- a/guestmetric/guestmetric_linux.go +++ b/guestmetric/guestmetric_linux.go @@ -100,7 +100,7 @@ func EnumNetworkAddresses(iface string) (GuestMetric, error) { v4re = IFCONFIG_IPV4_ADDR_RE v6re = IFCONFIG_IPV6_ADDR_RE } else { - return nil, fmt.Errorf("Cannot found ip/ifconfig command") + return nil, fmt.Errorf("Cannot find ip/ifconfig command") } m := v4re.FindAllStringSubmatch(out, -1) @@ -204,7 +204,8 @@ func (c *Collector) CollectDisk() (GuestMetric, error) { name := path blkid, err := runCmd("blkid", "-s", "UUID", path) if err != nil { - return nil, err + // ignore blkid errors + blkid = "" } if strings.Contains(blkid, "=") { parts := strings.SplitN(strings.TrimSpace(blkid), "=", 2) |