Browse Source

Logs for Restart

Signed-off-by: David Gageot <david@gageot.net>
David Gageot 3 years ago
parent
commit
80518f988a
1 changed files with 8 additions and 11 deletions
  1. 8
    11
      drivers/openstack/openstack.go

+ 8
- 11
drivers/openstack/openstack.go View File

@@ -400,6 +400,14 @@ func (d *Driver) Stop() error {
400 400
 	return d.client.StopInstance(d)
401 401
 }
402 402
 
403
+func (d *Driver) Restart() error {
404
+	if err := d.initCompute(); err != nil {
405
+		return err
406
+	}
407
+
408
+	return d.client.RestartInstance(d)
409
+}
410
+
403 411
 func (d *Driver) Remove() error {
404 412
 	log.Debug("deleting instance...", map[string]string{"MachineId": d.MachineId})
405 413
 	log.Info("Deleting OpenStack instance...")
@@ -417,17 +425,6 @@ func (d *Driver) Remove() error {
417 425
 	return nil
418 426
 }
419 427
 
420
-func (d *Driver) Restart() error {
421
-	log.Info("Restarting OpenStack instance...", map[string]string{"MachineId": d.MachineId})
422
-	if err := d.initCompute(); err != nil {
423
-		return err
424
-	}
425
-	if err := d.client.RestartInstance(d); err != nil {
426
-		return err
427
-	}
428
-	return nil
429
-}
430
-
431 428
 func (d *Driver) Kill() error {
432 429
 	return d.Stop()
433 430
 }

Loading…
Cancel
Save