From 0fe4d79bbf031ad539b90208eff7530e8d0dcac3 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Wed, 5 Dec 2018 15:57:45 -0800 Subject: [PATCH] add validation to prevent users from being confused about format functionality --- builder/vmware/iso/config.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/builder/vmware/iso/config.go b/builder/vmware/iso/config.go index ec7d5822b..54ed11c28 100644 --- a/builder/vmware/iso/config.go +++ b/builder/vmware/iso/config.go @@ -167,7 +167,12 @@ func NewConfig(raws ...interface{}) (*Config, []string, error) { } } - if c.Format == "" { + if c.Format != "" { + if c.RemoteType != "esx5" { + errs = packer.MultiErrorAppend(errs, + fmt.Errorf("format is only valid when RemoteType=esx5")) + } + } else { c.Format = "ovf" }