At present, when using the packer fix command on a template that has
"ssh_private_ip" set to anything but a boolean value, the fixer will
fail, and appear to fail silently, simply returning a non-zero status
code without any message.
To determine what happened, users have to know to set PACKER_LOG=1 to
make the log message visible.
So far as I can tell, this is the only instance of log.Fatalf being
called, and based on the surrounding code the better solution would be
to return an error, which will then be visible to users of packer fix
without having to look in the logs.
The "ssh_private_ip" key works with either boolean values or string
representations of booleans. The fixer errors when the value is defined
as, for example, "true" (with quotation marks). This commit will attempt
to convert the string into a bool when necessary to ensure this case is
handled.
Signed-off-by: Brendan Devenney <brendan.devenney@cloudreach.com>
Revert so that we can merge a different branch that's had more recent work instead
This reverts commit ba518637d4, reversing
changes made to e56849c605.
- ssh_key_path is removed in all cases.
- The new fixer is not checking the builder type so it will execute for all
builders.
- If ssh_key_path exists without ssh_private_key_file then it will assign
the value of ssh_path_path to ssh_private_key_file
- If ssh_private_key_file and ssh_key_path exist, then ssh_key_path is
simply removed
I wanted to emit a warning messsage to the user but it didn't seem like
the ui.* interface was exposed to fixers.