mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 09:25:46 +03:00
Trim extra newline from kernel version
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user