Skip to content
This repository has been archived by the owner on Feb 27, 2018. It is now read-only.

Commit

Permalink
Merge pull request #215 from Moghedrin/master
Browse files Browse the repository at this point in the history
Exit on virtualbox initialization error
  • Loading branch information
Sven Dowideit authored and Sven Dowideit committed Aug 11, 2014
2 parents 3fe159d + 1155526 commit bd591d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion dummy/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ package dummy

import (
"fmt"
"os"

"github.com/boot2docker/boot2docker-cli/driver"
)

func init() {
driver.Register("dummy", InitFunc)
if err := driver.Register("dummy", InitFunc); err != nil {
fmt.Fprintf(os.Stderr, "Failed to initialize driver. Error : %s", err.Error())
os.Exit(1)
}
}

// Initialize the Machine.
Expand Down
5 changes: 4 additions & 1 deletion virtualbox/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ const (
)

func init() {
driver.Register("virtualbox", InitFunc)
if err := driver.Register("virtualbox", InitFunc); err != nil {
fmt.Fprintf(os.Stderr, "Failed to initialize driver. Error : %s", err.Error())
os.Exit(1)
}
}

// Initialize the Machine.
Expand Down

0 comments on commit bd591d5

Please sign in to comment.