Enable kernel.version on Windows

Previously, this value was guarded against running on Windows
because it called the `uname` command which is unlikely to
be there.

This change now sets the value from gopsutil, which might
well be an empty string.

Signed-off-by: Dave Walker (Daviey) <email@daviey.com>
This commit is contained in:
Dave Walker (Daviey) 2017-03-01 18:48:23 +00:00
parent 090e760928
commit 4958154640
1 changed files with 1 additions and 5 deletions

View File

@ -32,11 +32,7 @@ func (f *HostFingerprint) Fingerprint(cfg *config.Config, node *structs.Node) (b
node.Attributes["os.version"] = hostInfo.PlatformVersion
node.Attributes["kernel.name"] = runtime.GOOS
node.Attributes["kernel.version"] = ""
if runtime.GOOS != "windows" {
node.Attributes["kernel.version"] = hostInfo.KernelVersion
}
node.Attributes["kernel.version"] = hostInfo.KernelVersion
node.Attributes["unique.hostname"] = hostInfo.Hostname