Commit 9ad2b986 authored by Mikhail Zholobov's avatar Mikhail Zholobov

builder/parallels: Removed config parameter 'ostype'

We have to set either 'ostype' or 'distribution', but not both.
parent 77ae2014
...@@ -33,7 +33,6 @@ type config struct { ...@@ -33,7 +33,6 @@ type config struct {
ParallelsToolsMode string `mapstructure:"parallels_tools_mode"` ParallelsToolsMode string `mapstructure:"parallels_tools_mode"`
ParallelsToolsGuestPath string `mapstructure:"parallels_tools_guest_path"` ParallelsToolsGuestPath string `mapstructure:"parallels_tools_guest_path"`
ParallelsToolsHostPath string `mapstructure:"parallels_tools_host_path"` ParallelsToolsHostPath string `mapstructure:"parallels_tools_host_path"`
GuestOSType string `mapstructure:"guest_os_type"`
GuestOSDistribution string `mapstructure:"guest_os_distribution"` GuestOSDistribution string `mapstructure:"guest_os_distribution"`
HardDriveInterface string `mapstructure:"hard_drive_interface"` HardDriveInterface string `mapstructure:"hard_drive_interface"`
HostInterfaces []string `mapstructure:"host_interfaces"` HostInterfaces []string `mapstructure:"host_interfaces"`
...@@ -47,6 +46,9 @@ type config struct { ...@@ -47,6 +46,9 @@ type config struct {
RawSingleISOUrl string `mapstructure:"iso_url"` RawSingleISOUrl string `mapstructure:"iso_url"`
// Deprecated parameters
GuestOSType string `mapstructure:"guest_os_type"`
tpl *packer.ConfigTemplate tpl *packer.ConfigTemplate
} }
...@@ -95,10 +97,6 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) { ...@@ -95,10 +97,6 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
b.config.HardDriveInterface = "sata" b.config.HardDriveInterface = "sata"
} }
if b.config.GuestOSType == "" {
b.config.GuestOSType = "other"
}
if b.config.GuestOSDistribution == "" { if b.config.GuestOSDistribution == "" {
b.config.GuestOSDistribution = "other" b.config.GuestOSDistribution = "other"
} }
...@@ -125,7 +123,6 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) { ...@@ -125,7 +123,6 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
"parallels_tools_mode": &b.config.ParallelsToolsMode, "parallels_tools_mode": &b.config.ParallelsToolsMode,
"parallels_tools_host_path": &b.config.ParallelsToolsHostPath, "parallels_tools_host_path": &b.config.ParallelsToolsHostPath,
"parallels_tools_guest_path": &b.config.ParallelsToolsGuestPath, "parallels_tools_guest_path": &b.config.ParallelsToolsGuestPath,
"guest_os_type": &b.config.GuestOSType,
"guest_os_distribution": &b.config.GuestOSDistribution, "guest_os_distribution": &b.config.GuestOSDistribution,
"hard_drive_interface": &b.config.HardDriveInterface, "hard_drive_interface": &b.config.HardDriveInterface,
"http_directory": &b.config.HTTPDir, "http_directory": &b.config.HTTPDir,
......
...@@ -42,8 +42,8 @@ func TestBuilderPrepare_Defaults(t *testing.T) { ...@@ -42,8 +42,8 @@ func TestBuilderPrepare_Defaults(t *testing.T) {
t.Errorf("bad parallels tools mode: %s", b.config.ParallelsToolsMode) t.Errorf("bad parallels tools mode: %s", b.config.ParallelsToolsMode)
} }
if b.config.GuestOSType != "other" { if b.config.GuestOSDistribution != "other" {
t.Errorf("bad guest OS type: %s", b.config.GuestOSType) t.Errorf("bad guest OS distribution: %s", b.config.GuestOSDistribution)
} }
if b.config.VMName != "packer-foo" { if b.config.VMName != "packer-foo" {
......
...@@ -28,7 +28,6 @@ func (s *stepCreateVM) Run(state multistep.StateBag) multistep.StepAction { ...@@ -28,7 +28,6 @@ func (s *stepCreateVM) Run(state multistep.StateBag) multistep.StepAction {
commands := make([][]string, 8) commands := make([][]string, 8)
commands[0] = []string{ commands[0] = []string{
"create", name, "create", name,
"--ostype", config.GuestOSType,
"--distribution", config.GuestOSDistribution, "--distribution", config.GuestOSDistribution,
"--dst", path, "--dst", path,
"--vmtype", "vm", "--vmtype", "vm",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment