From cd817aebd848facda29e0befbbd6e31bf22402e6 Mon Sep 17 00:00:00 2001 From: deads2k Date: Wed, 20 May 2015 13:15:49 -0400 Subject: [PATCH] tolerate fatals without newlines --- pkg/kubectl/cmd/util/helpers.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/kubectl/cmd/util/helpers.go b/pkg/kubectl/cmd/util/helpers.go index 66754d7b31e..8ba64e1b576 100644 --- a/pkg/kubectl/cmd/util/helpers.go +++ b/pkg/kubectl/cmd/util/helpers.go @@ -146,9 +146,13 @@ func messageForError(err error) string { } // fatal prints the message and then exits. If V(2) or greater, glog.Fatal -// is invoked for extended information. The provided msg should end in a -// newline. +// is invoked for extended information. func fatal(msg string) { + // add newline if needed + if !strings.HasSuffix(msg, "\n") { + msg += "\n" + } + if glog.V(2) { glog.FatalDepth(2, msg) }