From ac3b74f2af7f68fbeb218cca16c8d70f301ceaab Mon Sep 17 00:00:00 2001 From: Shlomi Zadok Date: Thu, 30 Oct 2014 16:32:08 +0200 Subject: [PATCH] reload libvirt actions to get current state --- lib/fog/libvirt/models/compute/server.rb | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/lib/fog/libvirt/models/compute/server.rb b/lib/fog/libvirt/models/compute/server.rb index 43e95df04..873de0bed 100644 --- a/lib/fog/libvirt/models/compute/server.rb +++ b/lib/fog/libvirt/models/compute/server.rb @@ -66,9 +66,9 @@ module Fog def start return true if active? - service.vm_action(uuid, :create) + action_status = service.vm_action(uuid, :create) reload - true + action_status end def mac @@ -87,23 +87,33 @@ module Fog end def reboot - service.vm_action(uuid, :reboot) + action_status = service.vm_action(uuid, :reboot) + reload + action_status end def poweroff - service.vm_action(uuid, :destroy) + action_status = service.vm_action(uuid, :destroy) + reload + action_status end def shutdown - service.vm_action(uuid, :shutdown) + action_status = service.vm_action(uuid, :shutdown) + reload + action_status end def resume - service.vm_action(uuid, :resume) + action_status = service.vm_action(uuid, :resume) + reload + action_status end def suspend - service.vm_action(uuid, :suspend) + action_status = service.vm_action(uuid, :suspend) + reload + action_status end def stopped?