Commit 74177487 authored by Matthew Hooker's avatar Matthew Hooker

builder/digitalocean: Scrub config before logging [GH-516]

parent ff970483
...@@ -11,6 +11,7 @@ import ( ...@@ -11,6 +11,7 @@ import (
"github.com/mitchellh/packer/packer" "github.com/mitchellh/packer/packer"
"log" "log"
"os" "os"
"strings"
"time" "time"
) )
...@@ -164,7 +165,10 @@ func (b *Builder) Prepare(raws ...interface{}) error { ...@@ -164,7 +165,10 @@ func (b *Builder) Prepare(raws ...interface{}) error {
return errs return errs
} }
log.Printf("Config: %+v", b.config) configRepr := fmt.Sprintf("Config: %+v", b.config)
scrubbedConfig := strings.Replace(configRepr, b.config.ClientID, "CLIENT_ID", -1)
scrubbedConfig = strings.Replace(scrubbedConfig, b.config.APIKey, "API_KEY", -1)
log.Println(scrubbedConfig)
return nil return nil
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment