From 92d7e8ce65a5248afd51ca5482e28a43b0b150af Mon Sep 17 00:00:00 2001 From: Alex Quick Date: Fri, 15 Dec 2017 09:22:56 -0500 Subject: [PATCH] [config] let user know if they are unsetting a non-existent config key --- plugins/config/config.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plugins/config/config.go b/plugins/config/config.go index cb1b3d744..55e09685e 100644 --- a/plugins/config/config.go +++ b/plugins/config/config.go @@ -70,9 +70,15 @@ func UnsetMany(appName string, keys []string, restart bool) (err error) { if err = validateKey(k); err != nil { return } - common.LogInfo1(fmt.Sprintf("Unsetting %s", k)) - env.Unset(k) - changed = true + } + for _, k := range keys { + if _, hasKey := env.Map()[k]; hasKey { + common.LogInfo1(fmt.Sprintf("Unsetting %s", k)) + env.Unset(k) + changed = true + } else { + common.LogInfo1(fmt.Sprintf("Skipping %s, it is not set in the environment", k)) + } } if changed { env.Write()