[ovirt] fix waiting for VM to be stopped
The vm.stopped? method on ovirt was not behaving correctly, as it was returning `true` also when the state was `powering_down`. I've noticed this when fixing reboot, that also need to wait for vm to be stopped, and even when adding `stopped?`, it was still failing with: [Operation Failed: [Cannot run VM because the VM is in Powering Down status.]
This commit is contained in:
parent
43b06a0130
commit
84a126f14f
|
@ -44,7 +44,7 @@ module Fog
|
|||
end
|
||||
|
||||
def stopped?
|
||||
!!(status =~ /down/i)
|
||||
status.downcase == 'down'
|
||||
end
|
||||
|
||||
def mac
|
||||
|
@ -134,7 +134,10 @@ module Fog
|
|||
end
|
||||
|
||||
def reboot(options = {})
|
||||
stop unless stopped?
|
||||
unless stopped?
|
||||
stop
|
||||
wait_for { stopped? }
|
||||
end
|
||||
start options.merge(:blocking => true)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue