From 76c8cfd498e35d9569c6e69403228da9248ed7ff Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Mon, 18 May 2015 15:13:01 -0700 Subject: [PATCH 1/2] common: don't scrub "" If the access_key or secret_key were loaded from somewhere other than the packer file then ScrubConfig can get called to scrub "" and "". This results in very long output: <Fi... Don't do that. --- common/config.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/config.go b/common/config.go index 72b3bdd27..d821faf35 100644 --- a/common/config.go +++ b/common/config.go @@ -18,6 +18,9 @@ import ( func ScrubConfig(target interface{}, values ...string) string { conf := fmt.Sprintf("Config: %+v", target) for _, value := range values { + if value == "" { + continue + } conf = strings.Replace(conf, value, "", -1) } return conf From 2fe785ed350f65cef85edc68035e169e8ddad52d Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Thu, 16 Apr 2015 15:08:28 -0700 Subject: [PATCH 2/2] common: remove dead code The referenced bug was fixed in Go 1.2, and Packer requires Go 1.2+. --- common/config.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/common/config.go b/common/config.go index d821faf35..db001056b 100644 --- a/common/config.go +++ b/common/config.go @@ -161,14 +161,6 @@ func DownloadableURL(original string) (string, error) { // Make sure it is lowercased url.Scheme = strings.ToLower(url.Scheme) - // This is to work around issue #5927. This can safely be removed once - // we distribute with a version of Go that fixes that bug. - // - // See: https://code.google.com/p/go/issues/detail?id=5927 - if url.Path != "" && url.Path[0] != '/' { - url.Path = "/" + url.Path - } - // Verify that the scheme is something we support in our common downloader. supported := []string{"file", "http", "https"} found := false