This repository was archived by the owner on Feb 27, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ import (
1818 _ "github.com/boot2docker/boot2docker-cli/virtualbox"
1919)
2020
21+ func vmNotRunningError (vmName string ) error {
22+ return fmt .Errorf ("VM %q is not running. (Did you run `boot2docker up`?)" , vmName )
23+ }
24+
2125// Initialize the boot2docker VM from scratch.
2226func cmdInit () error {
2327 B2D .Init = false
@@ -165,7 +169,7 @@ func cmdShellInit() error {
165169 }
166170
167171 if m .GetState () != driver .Running {
168- return fmt . Errorf ( "VM %q is not running." , B2D .VM )
172+ return vmNotRunningError ( B2D .VM )
169173 }
170174
171175 socket , err := RequestSocketFromSSH (m )
@@ -506,7 +510,7 @@ func cmdSSH() error {
506510 }
507511
508512 if m .GetState () != driver .Running {
509- return fmt . Errorf ( "VM %q is not running." , B2D .VM )
513+ return vmNotRunningError ( B2D .VM )
510514 }
511515
512516 // find the ssh cmd string and then pass any remaining strings to ssh
@@ -530,7 +534,7 @@ func cmdIP() error {
530534 }
531535
532536 if m .GetState () != driver .Running {
533- return fmt . Errorf ( "VM %q is not running." , B2D .VM )
537+ return vmNotRunningError ( B2D .VM )
534538 }
535539
536540 IP := ""
You can’t perform that action at this time.
0 commit comments