From af2d9dfe90dc558284b8ad22c1b586add83efe65 Mon Sep 17 00:00:00 2001 From: Jeff Malnick Date: Fri, 20 Nov 2020 09:27:44 -0800 Subject: [PATCH] fix: do not print info in output that could be JSON or YAML format (#799) * fix: print err msg for no credentials found to stderr --- CHANGELOG.md | 8 ++++++++ internal/cmd/base/base.go | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54ddd52c5a..8e291d838a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ Canonical reference for changes, improvements, and bugfixes for Boundary. +## vNext + +### Bug Fixes + +* cli: Ensure errors print to stderr when token is not found + ([Issue](https://github.com/hashicorp/boundary/issues/791)) + ([PR](https://github.com/hashicorp/boundary/pull/799)] + ## v0.1.2 ### New and Improved diff --git a/internal/cmd/base/base.go b/internal/cmd/base/base.go index 6f9ba1c283..886ff5891f 100644 --- a/internal/cmd/base/base.go +++ b/internal/cmd/base/base.go @@ -314,7 +314,7 @@ func (c *Command) ReadTokenFromKeyring(keyringType, tokenName string) *authtoken token, err = zkeyring.Get("HashiCorp Boundary Auth Token", tokenName) if err != nil { if err == zkeyring.ErrNotFound { - c.UI.Info("No saved credential found, continuing without") + c.UI.Error("No saved credential found, continuing without") } else { c.UI.Error(fmt.Sprintf("Error reading auth token from keyring: %s", err)) c.UI.Warn("Token must be provided via BOUNDARY_TOKEN env var or -token flag. Reading the token can also be disabled via -keyring-type=none.")