mirror of https://github.com/docker/docs.git
Merge pull request #1811 from ehazlett/debug-env-var
change debug env var to MACHINE_DEBUG
This commit is contained in:
commit
bd168c4050
|
@ -661,7 +661,7 @@ func createDiskImage(dest string, size int, r io.Reader) error {
|
||||||
cmd := exec.Command(vboxManageCmd, "convertfromraw", "stdin", dest,
|
cmd := exec.Command(vboxManageCmd, "convertfromraw", "stdin", dest,
|
||||||
fmt.Sprintf("%d", sizeBytes), "--format", "VMDK")
|
fmt.Sprintf("%d", sizeBytes), "--format", "VMDK")
|
||||||
|
|
||||||
if os.Getenv("DEBUG") != "" {
|
if os.Getenv("MACHINE_DEBUG") != "" {
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
cmd.Stderr = os.Stderr
|
cmd.Stderr = os.Stderr
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ var (
|
||||||
|
|
||||||
func vmrun(args ...string) (string, string, error) {
|
func vmrun(args ...string) (string, string, error) {
|
||||||
cmd := exec.Command(vmrunbin, args...)
|
cmd := exec.Command(vmrunbin, args...)
|
||||||
if os.Getenv("DEBUG") != "" {
|
if os.Getenv("MACHINE_DEBUG") != "" {
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
cmd.Stderr = os.Stderr
|
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).
|
// Make a vmdk disk image with the given size (in MB).
|
||||||
func vdiskmanager(dest string, size int) error {
|
func vdiskmanager(dest string, size int) error {
|
||||||
cmd := exec.Command(vdiskmanbin, "-c", "-t", "0", "-s", fmt.Sprintf("%dMB", size), "-a", "lsilogic", dest)
|
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.Stdout = os.Stdout
|
||||||
cmd.Stderr = os.Stderr
|
cmd.Stderr = os.Stderr
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,11 +42,11 @@ var (
|
||||||
// TODO: I think this is superflous and can be replaced by one check for if
|
// 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.
|
// debug is on that sets a variable in this module.
|
||||||
func isDebug() bool {
|
func isDebug() bool {
|
||||||
debugEnv := os.Getenv("DEBUG")
|
debugEnv := os.Getenv("MACHINE_DEBUG")
|
||||||
if debugEnv != "" {
|
if debugEnv != "" {
|
||||||
showDebug, err := strconv.ParseBool(debugEnv)
|
showDebug, err := strconv.ParseBool(debugEnv)
|
||||||
if err != nil {
|
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)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
return showDebug
|
return showDebug
|
||||||
|
|
Loading…
Reference in New Issue