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:

<Filtered><<Filtered>F<Filtered>i...

Don't do that.
This commit is contained in:
Josh Bleecher Snyder 2015-05-18 15:13:01 -07:00
parent 350a5f8cad
commit 76c8cfd498
1 changed files with 3 additions and 0 deletions

View File

@ -18,6 +18,9 @@ import (
func ScrubConfig(target interface{}, values ...string) string { func ScrubConfig(target interface{}, values ...string) string {
conf := fmt.Sprintf("Config: %+v", target) conf := fmt.Sprintf("Config: %+v", target)
for _, value := range values { for _, value := range values {
if value == "" {
continue
}
conf = strings.Replace(conf, value, "<Filtered>", -1) conf = strings.Replace(conf, value, "<Filtered>", -1)
} }
return conf return conf