From 36f5033d9787f85e97cc259fcb33bd699f3dbe0f Mon Sep 17 00:00:00 2001 From: Sean Chittenden Date: Mon, 6 Feb 2017 16:10:46 -0800 Subject: [PATCH] Unconditionally lowercase the `HostID` from all supported platforms. --- host/host_darwin.go | 2 +- host/host_freebsd.go | 2 +- host/host_linux.go | 4 ++-- host/host_windows.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/host/host_darwin.go b/host/host_darwin.go index 08e9809..bbd134f 100644 --- a/host/host_darwin.go +++ b/host/host_darwin.go @@ -59,7 +59,7 @@ func Info() (*InfoStat, error) { values, err := common.DoSysctrl("kern.uuid") if err == nil && len(values) == 1 && values[0] != "" { - ret.HostID = values[0] + ret.HostID = strings.ToLower(values[0]) } return ret, nil diff --git a/host/host_freebsd.go b/host/host_freebsd.go index 481d3df..74137cb 100644 --- a/host/host_freebsd.go +++ b/host/host_freebsd.go @@ -62,7 +62,7 @@ func Info() (*InfoStat, error) { values, err := common.DoSysctrl("kern.hostuuid") if err == nil && len(values) == 1 && values[0] != "" { - ret.HostID = values[0] + ret.HostID = strings.ToLower(values[0]) } return ret, nil diff --git a/host/host_linux.go b/host/host_linux.go index 69cc138..a34c67d 100644 --- a/host/host_linux.go +++ b/host/host_linux.go @@ -70,14 +70,14 @@ func Info() (*InfoStat, error) { case common.PathExists(sysProductUUID): lines, err := common.ReadLines(sysProductUUID) if err == nil && len(lines) > 0 && lines[0] != "" { - ret.HostID = lines[0] + ret.HostID = strings.ToLower(lines[0]) break } fallthrough default: values, err := common.DoSysctrl("kernel.random.boot_id") if err == nil && len(values) == 1 && values[0] != "" { - ret.HostID = values[0] + ret.HostID = strings.ToLower(values[0]) } } diff --git a/host/host_windows.go b/host/host_windows.go index a689d47..b5fb322 100644 --- a/host/host_windows.go +++ b/host/host_windows.go @@ -64,7 +64,7 @@ func Info() (*InfoStat, error) { { hostID, err := getMachineGuid() if err == nil { - ret.HostID = hostID + ret.HostID = strings.ToLower(hostID) } }