Merge pull request #313 from sean-/lowercase-hostid

Unconditionally lowercase the `HostID` from all supported platforms.
This commit is contained in:
shirou 2017-02-08 11:55:55 +09:00 committed by GitHub
commit b62e301a8b
4 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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])
}
}

View File

@ -64,7 +64,7 @@ func Info() (*InfoStat, error) {
{
hostID, err := getMachineGuid()
if err == nil {
ret.HostID = hostID
ret.HostID = strings.ToLower(hostID)
}
}