diff --git a/driver/driver.go b/driver/driver.go index 9b5524a..525ee9b 100644 --- a/driver/driver.go +++ b/driver/driver.go @@ -51,8 +51,9 @@ var ( // All registred machines machines map[string]InitFunc - ErrNotSupported = errors.New("machine not supported") + ErrNotSupported = errors.New("driver not supported") ErrMachineNotExist = errors.New("machine not exist") + ErrMachineExist = errors.New("machine already exists") ErrPrerequisites = errors.New("prerequisites for machine not satisfied (hypervisor installed?)") ) diff --git a/virtualbox/machine.go b/virtualbox/machine.go index 2009d01..54d3059 100644 --- a/virtualbox/machine.go +++ b/virtualbox/machine.go @@ -330,7 +330,7 @@ func GetMachine(id string) (*Machine, error) { stdout, stderr, err := vbmOutErr("showvminfo", id, "--machinereadable") if err != nil { if reMachineNotFound.FindString(stderr) != "" { - return nil, ErrMachineNotExist + return nil, driver.ErrMachineNotExist } return nil, err } @@ -443,7 +443,7 @@ func CreateMachine(mc *driver.MachineConfig) (*Machine, error) { } for _, m := range machineNames { if m == mc.VM { - return nil, ErrMachineExist + return nil, driver.ErrMachineExist } } diff --git a/virtualbox/vbm.go b/virtualbox/vbm.go index 641c071..a4f534f 100644 --- a/virtualbox/vbm.go +++ b/virtualbox/vbm.go @@ -25,9 +25,7 @@ var ( ) var ( - ErrMachineExist = errors.New("machine already exists") - ErrMachineNotExist = errors.New("machine does not exist") - ErrVBMNotFound = errors.New("VBoxManage not found") + ErrVBMNotFound = errors.New("VBoxManage not found") ) func vbm(args ...string) error {