Commit 7d1b95c9 authored by Danny Lockard's avatar Danny Lockard

Formatting fix :)

parent fdcf10dc
...@@ -18,9 +18,9 @@ import ( ...@@ -18,9 +18,9 @@ import (
type Driver interface { type Driver interface {
// Create a SATA controller. // Create a SATA controller.
CreateSATAController(vm string, controller string) error CreateSATAController(vm string, controller string) error
// Create a SCSI controller. // Create a SCSI controller.
CreateSCSIController(vm string, controller string) error CreateSCSIController(vm string, controller string) error
// Delete a VM by name // Delete a VM by name
Delete(string) error Delete(string) error
......
...@@ -42,7 +42,7 @@ func (d *VBox42Driver) CreateSCSIController(vmName string, name string) error { ...@@ -42,7 +42,7 @@ func (d *VBox42Driver) CreateSCSIController(vmName string, name string) error {
"storagectl", vmName, "storagectl", vmName,
"--name", name, "--name", name,
"--add", "scsi", "--add", "scsi",
"--controller", "LSILogic", "--controller", "LSILogic",
} }
return d.VBoxManage(command...) return d.VBoxManage(command...)
......
...@@ -9,7 +9,7 @@ type DriverMock struct { ...@@ -9,7 +9,7 @@ type DriverMock struct {
CreateSATAControllerController string CreateSATAControllerController string
CreateSATAControllerErr error CreateSATAControllerErr error
CreateSCSIControllerVM string CreateSCSIControllerVM string
CreateSCSIControllerController string CreateSCSIControllerController string
CreateSCSIControllerErr error CreateSCSIControllerErr error
...@@ -54,9 +54,9 @@ func (d *DriverMock) CreateSATAController(vm string, controller string) error { ...@@ -54,9 +54,9 @@ func (d *DriverMock) CreateSATAController(vm string, controller string) error {
} }
func (d *DriverMock) CreateSCSIController(vm string, controller string) error { func (d *DriverMock) CreateSCSIController(vm string, controller string) error {
d.CreateSCSIControllerVM = vm d.CreateSCSIControllerVM = vm
d.CreateSCSIControllerController = vm d.CreateSCSIControllerController = vm
return d.CreateSCSIControllerErr return d.CreateSCSIControllerErr
} }
func (d *DriverMock) Delete(name string) error { func (d *DriverMock) Delete(name string) error {
......
...@@ -63,24 +63,24 @@ func (s *stepCreateDisk) Run(state multistep.StateBag) multistep.StepAction { ...@@ -63,24 +63,24 @@ func (s *stepCreateDisk) Run(state multistep.StateBag) multistep.StepAction {
} }
} }
if config.HardDriveInterface == "scsi" { if config.HardDriveInterface == "scsi" {
if err := driver.CreateSCSIController(vmName, "SCSI Controller"); err != nil { if err := driver.CreateSCSIController(vmName, "SCSI Controller"); err != nil {
err := fmt.Errorf("Error creating disk controller: %s", err) err := fmt.Errorf("Error creating disk controller: %s", err)
state.Put("error", err) state.Put("error", err)
ui.Error(err.Error()) ui.Error(err.Error())
return multistep.ActionHalt return multistep.ActionHalt
} }
} }
// Attach the disk to the controller // Attach the disk to the controller
controllerName := "IDE Controller" controllerName := "IDE Controller"
if config.HardDriveInterface == "sata" { if config.HardDriveInterface == "sata" {
controllerName = "SATA Controller" controllerName = "SATA Controller"
} }
if config.HardDriveInterface == "scsi" { if config.HardDriveInterface == "scsi" {
controllerName = "SCSI Controller" controllerName = "SCSI Controller"
} }
command = []string{ command = []string{
"storageattach", vmName, "storageattach", vmName,
......
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