mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-25 01:04:00 -04:00
Merge pull request #518 from mitchellh/fix516
builder/digitalocean: Scrub config before logging
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"github.com/mitchellh/packer/packer"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -164,7 +165,10 @@ func (b *Builder) Prepare(raws ...interface{}) error {
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user