Trim extra newline from kernel version

This commit is contained in:
Abhishek Chanda
2015-10-15 00:54:21 -07:00
parent 607da3f784
commit 6df3a21ee7
2 changed files with 3 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ import (
"log"
"os/exec"
"runtime"
"strings"
"github.com/hashicorp/nomad/client/config"
"github.com/hashicorp/nomad/nomad/structs"
@@ -40,7 +41,7 @@ func (f *HostFingerprint) Fingerprint(cfg *config.Config, node *structs.Node) (b
if err != nil {
return false, fmt.Errorf("Failed to run uname: %s", err)
}
node.Attributes["kernel.version"] = string(out)
node.Attributes["kernel.version"] = strings.Trim(string(out), "\n")
}
node.Attributes["hostname"] = hostInfo.Hostname

View File

@@ -52,7 +52,7 @@ be specified using the `?region=` query parameter.
"driver.java.vm": "Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)",
"hostname": "Armons-MacBook-Air.local",
"kernel.name": "darwin",
"kernel.version": "14.4.0\n",
"kernel.version": "14.4.0",
"memory.totalbytes": "8589934592",
"os.name": "darwin",
"os.version": "14.4.0",