Skip to content

Commit

Permalink
Corrections in error and status messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
rajch committed Jun 18, 2021
1 parent a0fe279 commit 5e16230
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
10 changes: 7 additions & 3 deletions driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package drivervbox

const (
driverName = "vbox"
driverDescription = "Kutti driver for VirtualBox >=6.0"
driverDescription = "Kutti driver for VirtualBox 6.0 and above"
networkNameSuffix = "kuttinet"
networkNamePattern = "*" + networkNameSuffix
dhcpaddress = "192.168.125.3"
Expand All @@ -27,7 +27,7 @@ func (vd *Driver) Name() string {
return driverName
}

// Description returns "Kutti driver for VirtualBox >=6.0"
// Description returns "Kutti driver for VirtualBox 6.0 and above"
func (vd *Driver) Description() string {
return driverDescription
}
Expand All @@ -43,7 +43,11 @@ func (vd *Driver) Status() string {
}

func (vd *Driver) Error() string {
panic("not implemented") // TODO: Implement
if vd.status != "Error" {
return ""
}

return vd.errormessage
}

func trimQuotes(s string) string {
Expand Down
9 changes: 7 additions & 2 deletions drivervbox-findvboxmanage.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

package drivervbox

import "os/exec"
import (
"errors"
"os/exec"
)

func findvboxmanage() (string, error) {

Expand All @@ -13,5 +16,7 @@ func findvboxmanage() (string, error) {
}

// Give up
return "", err
return "", errors.New(
"VBoxManage not found. Please ensure that Oracle VirtualBox 6.0 or greater is installed, and the VBoxManage utility is on your PATH",
)
}
4 changes: 3 additions & 1 deletion drivervbox-findvboxmanage_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ func findvboxmanage() (string, error) {
}

// Give up
return "", err
return "", errors.New(
"VBoxManage.exe not found. Please ensure that Oracle VirtualBox 6.0 or greater is installed, and VBoxManage.exe utility is on your PATH",
)
}

0 comments on commit 5e16230

Please sign in to comment.