Permalink
Browse files

Start machine if needed for upgrade

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
  • Loading branch information...
nathanleclaire committed Feb 22, 2017
1 parent e40b9b3 commit e55dfb2618124af6058f4ea7489265af3cf13ee8
Showing with 6 additions and 5 deletions.
  1. +6 −5 libmachine/host/host.go
View
@@ -1,7 +1,6 @@
package host
import (
"errors"
"regexp"
"github.com/docker/machine/libmachine/auth"
@@ -19,9 +18,8 @@ import (
)
var (
validHostNamePattern = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9\-\.]*$`)
errMachineMustBeRunningForUpgrade = errors.New("machine must be running to upgrade")
stdSSHClientCreator SSHClientCreator = &StandardSSHClientCreator{}
validHostNamePattern = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9\-\.]*$`)
stdSSHClientCreator SSHClientCreator = &StandardSSHClientCreator{}
)
type SSHClientCreator interface {
@@ -171,7 +169,10 @@ func (h *Host) Upgrade() error {
}
if machineState != state.Running {
return errMachineMustBeRunningForUpgrade
log.Info("Starting machine so machine can be upgraded...")
if err := h.Start(); err != nil {
return err
}
}
provisioner, err := provision.DetectProvisioner(h.Driver)

0 comments on commit e55dfb2

Please sign in to comment.