change debug env var to MACHINE_DEBUG

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
Evan Hazlett 2015-09-05 08:57:03 -04:00
parent 08208bd141
commit 3c712ae30a
No known key found for this signature in database
GPG Key ID: A519480096146526
4 changed files with 6 additions and 6 deletions

View File

@ -661,7 +661,7 @@ func createDiskImage(dest string, size int, r io.Reader) error {
cmd := exec.Command(vboxManageCmd, "convertfromraw", "stdin", dest,
fmt.Sprintf("%d", sizeBytes), "--format", "VMDK")
if os.Getenv("DEBUG") != "" {
if os.Getenv("MACHINE_DEBUG") != "" {
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
}

View File

@ -28,7 +28,7 @@ var (
func vmrun(args ...string) (string, string, error) {
cmd := exec.Command(vmrunbin, args...)
if os.Getenv("DEBUG") != "" {
if os.Getenv("MACHINE_DEBUG") != "" {
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
}
@ -51,7 +51,7 @@ func vmrun(args ...string) (string, string, error) {
// Make a vmdk disk image with the given size (in MB).
func vdiskmanager(dest string, size int) error {
cmd := exec.Command(vdiskmanbin, "-c", "-t", "0", "-s", fmt.Sprintf("%dMB", size), "-a", "lsilogic", dest)
if os.Getenv("DEBUG") != "" {
if os.Getenv("MACHINE_DEBUG") != "" {
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
}

View File

@ -42,11 +42,11 @@ var (
// TODO: I think this is superflous and can be replaced by one check for if
// debug is on that sets a variable in this module.
func isDebug() bool {
debugEnv := os.Getenv("DEBUG")
debugEnv := os.Getenv("MACHINE_DEBUG")
if debugEnv != "" {
showDebug, err := strconv.ParseBool(debugEnv)
if err != nil {
fmt.Fprintln(os.Stderr, "Error parsing boolean value from DEBUG: %s", err)
fmt.Fprintln(os.Stderr, "Error parsing boolean value from MACHINE_DEBUG: %s", err)
os.Exit(1)
}
return showDebug

View File

@ -47,7 +47,7 @@ Options:
func main() {
for _, f := range os.Args {
if f == "-D" || f == "--debug" || f == "-debug" {
os.Setenv("DEBUG", "1")
os.Setenv("MACHINE_DEBUG", "1")
}
}