Merge pull request #7997 from hashicorp/7953

need to scrub sensitive variables first, to make sure we don't fail f…
This commit is contained in:
Megan Marsh 2019-08-16 09:47:36 -07:00 committed by GitHub
commit 68d50d272b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -335,15 +335,15 @@ func (u *MachineReadableUi) Machine(category string, args ...string) {
// Prepare the args
for i, v := range args {
args[i] = strings.Replace(v, ",", "%!(PACKER_COMMA)", -1)
args[i] = strings.Replace(args[i], "\r", "\\r", -1)
args[i] = strings.Replace(args[i], "\n", "\\n", -1)
// Use LogSecretFilter to scrub out sensitive variables
for s := range LogSecretFilter.s {
if s != "" {
args[i] = strings.Replace(args[i], s, "<sensitive>", -1)
}
}
args[i] = strings.Replace(v, ",", "%!(PACKER_COMMA)", -1)
args[i] = strings.Replace(args[i], "\r", "\\r", -1)
args[i] = strings.Replace(args[i], "\n", "\\n", -1)
}
argsString := strings.Join(args, ",")