From 6df3a21ee7f7a54cec394f63dbf28f2a56e2f360 Mon Sep 17 00:00:00 2001 From: Abhishek Chanda Date: Thu, 15 Oct 2015 00:54:21 -0700 Subject: [PATCH] Trim extra newline from kernel version --- client/fingerprint/host.go | 3 ++- website/source/docs/http/node.html.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/client/fingerprint/host.go b/client/fingerprint/host.go index 5cbfee755..6e5244bf9 100644 --- a/client/fingerprint/host.go +++ b/client/fingerprint/host.go @@ -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 diff --git a/website/source/docs/http/node.html.md b/website/source/docs/http/node.html.md index 42d8e4075..f16131f97 100644 --- a/website/source/docs/http/node.html.md +++ b/website/source/docs/http/node.html.md @@ -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",