Formatting fix :)

This commit is contained in:
Danny Lockard 2015-01-16 10:34:12 -06:00
parent fdcf10dc64
commit 7d1b95c907
4 changed files with 20 additions and 20 deletions

View File

@ -18,9 +18,9 @@ import (
type Driver interface {
// Create a SATA controller.
CreateSATAController(vm string, controller string) error
// Create a SCSI controller.
CreateSCSIController(vm string, controller string) error
// Create a SCSI controller.
CreateSCSIController(vm string, controller string) error
// Delete a VM by name
Delete(string) error

View File

@ -42,7 +42,7 @@ func (d *VBox42Driver) CreateSCSIController(vmName string, name string) error {
"storagectl", vmName,
"--name", name,
"--add", "scsi",
"--controller", "LSILogic",
"--controller", "LSILogic",
}
return d.VBoxManage(command...)

View File

@ -9,7 +9,7 @@ type DriverMock struct {
CreateSATAControllerController string
CreateSATAControllerErr error
CreateSCSIControllerVM string
CreateSCSIControllerVM string
CreateSCSIControllerController string
CreateSCSIControllerErr error
@ -54,9 +54,9 @@ func (d *DriverMock) CreateSATAController(vm string, controller string) error {
}
func (d *DriverMock) CreateSCSIController(vm string, controller string) error {
d.CreateSCSIControllerVM = vm
d.CreateSCSIControllerController = vm
return d.CreateSCSIControllerErr
d.CreateSCSIControllerVM = vm
d.CreateSCSIControllerController = vm
return d.CreateSCSIControllerErr
}
func (d *DriverMock) Delete(name string) error {

View File

@ -63,24 +63,24 @@ func (s *stepCreateDisk) Run(state multistep.StateBag) multistep.StepAction {
}
}
if config.HardDriveInterface == "scsi" {
if err := driver.CreateSCSIController(vmName, "SCSI Controller"); err != nil {
err := fmt.Errorf("Error creating disk controller: %s", err)
state.Put("error", err)
ui.Error(err.Error())
return multistep.ActionHalt
}
}
if config.HardDriveInterface == "scsi" {
if err := driver.CreateSCSIController(vmName, "SCSI Controller"); err != nil {
err := fmt.Errorf("Error creating disk controller: %s", err)
state.Put("error", err)
ui.Error(err.Error())
return multistep.ActionHalt
}
}
// Attach the disk to the controller
controllerName := "IDE Controller"
if config.HardDriveInterface == "sata" {
controllerName = "SATA Controller"
}
if config.HardDriveInterface == "scsi" {
controllerName = "SCSI Controller"
}
if config.HardDriveInterface == "scsi" {
controllerName = "SCSI Controller"
}
command = []string{
"storageattach", vmName,