workaround for mapstructure-to-hcl2 and booleans

pull/8511/head
Tommy McNeely 6 years ago
parent e101676e29
commit e469140678

@ -37,7 +37,7 @@ type Config struct {
SnapshotEnable bool `mapstructure:"snapshot_enable"`
SnapshotName string `mapstructure:"snapshot_name"`
SnapshotDescription string `mapstructure:"snapshot_description"`
ReregisterVM bool `mapstructure:"reregister_vm" default:true`
ReregisterVM bool `mapstructure:"reregister_vm" default:"true"`
ctx interpolate.Context
}

@ -25,7 +25,7 @@ type FlatConfig struct {
SnapshotEnable *bool `mapstructure:"snapshot_enable" cty:"snapshot_enable"`
SnapshotName *string `mapstructure:"snapshot_name" cty:"snapshot_name"`
SnapshotDescription *string `mapstructure:"snapshot_description" cty:"snapshot_description"`
ReregisterVM *bool `mapstructure:"reregister_vm" cty:"reregister_vm"`
ReregisterVM *bool `mapstructure:"reregister_vm" default:"true" cty:"reregister_vm"`
}
// FlatMapstructure returns a new FlatConfig.

@ -44,7 +44,6 @@ func (s *stepMarkAsTemplate) Run(ctx context.Context, state multistep.StateBag)
folder := state.Get("folder").(*object.Folder)
dcPath := state.Get("dcPath").(string)
vm, err := findRuntimeVM(cli, dcPath, s.VMName, s.RemoteFolder)
if err != nil {
state.Put("error", err)

Loading…
Cancel
Save