From e6a759206ecb7387bdef8e44cd666ec2a0f0c969 Mon Sep 17 00:00:00 2001 From: Quentin Perez Date: Mon, 18 Apr 2016 16:22:00 +0200 Subject: [PATCH 1/2] Sleep only when we stop an host --- driver/scaleway.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/driver/scaleway.go b/driver/scaleway.go index a9ebb0ce..a6990df7 100644 --- a/driver/scaleway.go +++ b/driver/scaleway.go @@ -34,6 +34,7 @@ type Driver struct { Token string commercialType string name string + stopping bool // size string // userDataFile string // ipv6 bool @@ -178,7 +179,9 @@ func (d *Driver) GetState() (st state.State, err error) { case "stopped": st = state.Stopped } - time.Sleep(5 * time.Second) + if d.stopping { + time.Sleep(5 * time.Second) + } return } @@ -240,5 +243,6 @@ func (d *Driver) Start() error { // Stop stops the server func (d *Driver) Stop() error { + d.stopping = true return d.postAction("poweroff") } From 3c015bb1c51beb87cbff633d8d305c4db28899b6 Mon Sep 17 00:00:00 2001 From: Quentin Perez Date: Mon, 18 Apr 2016 16:25:48 +0200 Subject: [PATCH 2/2] README.md: update --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9d994e2a..ec3c9087 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,7 @@ $> curl --silent http://212.47.248.251 | head -n1 # you can also open your brows ### master (unreleased) +* Sleep only when we stop an host ([#4](https://github.com/scaleway/docker-machine-driver-scaleway/issues/4)) * Support of `create` * Support of `start` * Support of `stop`