Better error reporting when a config key in template is Unknown

This patch will allow to fix the following bug much faster:

```
1 error(s) occurred:

* Unknown configuration key: output_directory
```

Related configuration:

```
"output_directory ": "build/sl_base/",
```

After the patch, the error reporting will be:

```
1 error(s) occurred:

* Unknown configuration key: "output_directory¤"
```
This commit is contained in:
Grégoire Pineau 2015-03-04 19:57:03 +01:00
parent 1b07d7eb5e
commit 97c56347a1

View File

@ -33,7 +33,7 @@ func CheckUnusedConfig(md *mapstructure.Metadata) *packer.MultiError {
for _, unused := range md.Unused {
if unused != "type" && !strings.HasPrefix(unused, "packer_") {
errs = append(
errs, fmt.Errorf("Unknown configuration key: %s", unused))
errs, fmt.Errorf("Unknown configuration key: %q", unused))
}
}
}