Merge pull request #4385 from josedonizetti/refactor-drivers-restart
Refactor: improve readability drivers.Restartpull/4548/head
commit
02b8032b59
|
@ -84,12 +84,11 @@ func publicSSHKeyPath(d *drivers.BaseDriver) string {
|
||||||
// Restart a host. This may just call Stop(); Start() if the provider does not
|
// Restart a host. This may just call Stop(); Start() if the provider does not
|
||||||
// have any special restart behaviour.
|
// have any special restart behaviour.
|
||||||
func Restart(d drivers.Driver) error {
|
func Restart(d drivers.Driver) error {
|
||||||
for _, f := range []func() error{d.Stop, d.Start} {
|
if err := d.Stop(); err != nil {
|
||||||
if err := f(); err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return nil
|
return d.Start()
|
||||||
}
|
}
|
||||||
|
|
||||||
// MakeDiskImage makes a boot2docker VM disk image.
|
// MakeDiskImage makes a boot2docker VM disk image.
|
||||||
|
|
Loading…
Reference in New Issue