Commit Graph

10 Commits

Author SHA1 Message Date
Vincent Bernat 3c16a870ac exoscale: move job waiting into a separate function
Waiting for a job to complete is split into a dedicated function,
outside of `waitForVM()`. Functions only waiting for the job to complete
will use this new function instead. The "job is done" testing logic is
also casted into a separate function.

The original `waitForVM()` function is now waiting for the job to
complete, then retrieve the VM. This introduces an extra API call which
could be avoided by having a `waitForJob()` return the last response but
this makes the code simpler for other users and adding a special variant
just for that seems to be overkill.

Signed-off-by: Vincent Bernat <Vincent.Bernat@exoscale.ch>
2015-06-03 09:33:17 +02:00
Vincent Bernat 2d25f56ff7 exoscale: use the new `utils.WaitForSpecificOrError` function to wait for job to finish
Instead of using a custom loop, use the newly introduced
`utils.WaitForSpecificOrError` function. Beware that on success, we use
the successful response to get the VM object (outside the loop).

Signed-off-by: Vincent Bernat <Vincent.Bernat@exoscale.ch>
2015-06-03 09:09:07 +02:00
Vincent Bernat 2a60a4ea32 exoscale: ensure we sleep a bit while waiting for the VM to be ready
Otherwise, the timeout is reached far too soon: instead of waiting for
the VM for two minutes, we wait only for a couple of seconds.

Signed-off-by: Vincent Bernat <Vincent.Bernat@exoscale.ch>
2015-06-03 09:09:07 +02:00
Vincent Bernat a6c58534ca exoscale: add the appropriate port to make Swarm work
Signed-off-by: Vincent Bernat <Vincent.Bernat@exoscale.ch>
2015-06-02 11:44:18 +02:00
Jan Broer bbbaa8952e exoscale: fixed 2 mins wait loop on failed operation
Signed-off-by: Jan Broer <janeczku@yahoo.de>
2015-05-23 06:09:01 +02:00
Evan Hazlett 19d3bdd389 Merge pull request #1208 from exoscale/fix/exoscale-ssh-keypair
exoscale: destroy the SSH keypair when removing the machine
2015-05-22 09:58:59 -04:00
Evan Hazlett f82032b28d remove provider
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-05-21 10:41:03 -04:00
Vincent Bernat d05a889c96 exoscale: simplify if/err pattern
Compact the if/err forms that can be compacted.

Signed-off-by: Vincent Bernat <Vincent.Bernat@exoscale.ch>
2015-05-21 14:34:42 +02:00
Vincent Bernat b772e66394 exoscale: destroy the SSH keypair when removing the machine
Otherwise, when recreating a machine with the same name, we would get an
error about this SSH keypair already existing.

To avoid any confusion, let's say that machine will handle all keypairs
and the user cannot provide its own. Therefore, move the keypairs into
their own "namespace" and remove the option to specify a keypair.

Signed-off-by: Vincent Bernat <Vincent.Bernat@exoscale.ch>
2015-05-21 14:34:42 +02:00
Vincent Bernat fd569c8fdf driver: exoscale driver
Add support for exoscale, a Swiss cloud provider. This pull "egoscale",
a Go binding for exoscale, in godeps.

Signed-off-by: Vincent Bernat <Vincent.Bernat@exoscale.ch>
2015-04-30 22:32:02 +02:00