Prevent hang on export for remote ESXi build due to empty remote_password

This commit is contained in:
DanHam 2018-06-08 10:49:17 +01:00
parent 5952892e10
commit c8199458a7
No known key found for this signature in database
GPG Key ID: 58E79AEDD6AA987E
1 changed files with 5 additions and 0 deletions

View File

@ -221,6 +221,11 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
fmt.Errorf("format must be one of ova, ovf, or vmx"))
}
if b.config.RemoteType == "esx5" && b.config.SkipExport != true && b.config.RemotePassword == "" {
errs = packer.MultiErrorAppend(errs,
fmt.Errorf("exporting the vm (with ovftool) requires that you set a value for remote_password"))
}
// Warnings
if b.config.ShutdownCommand == "" {
warnings = append(warnings,