need to scrub sensitive variables first, to make sure we don't fail for comma-containing sensitive info

This commit is contained in:
Megan Marsh 2019-08-15 16:16:11 -07:00
parent 316a30b31d
commit a82a3ccaa6
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, ",")