From bafac9547be5434bca5baef73acd2a86b1fd58ac Mon Sep 17 00:00:00 2001 From: Amos Benari Date: Sun, 24 Feb 2013 16:00:44 +0200 Subject: [PATCH] [ovirt] Updated the blocking start logic to fit oVirt 3.1 api --- lib/fog/ovirt/models/compute/server.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fog/ovirt/models/compute/server.rb b/lib/fog/ovirt/models/compute/server.rb index 5fb902cc4..7256878ee 100644 --- a/lib/fog/ovirt/models/compute/server.rb +++ b/lib/fog/ovirt/models/compute/server.rb @@ -33,7 +33,7 @@ module Fog end def locked? - !!(status =~ /locked/i) + !!(status =~ /locked/i) || (attributes[:volumes]=nil) || volumes.any?{|v| !!(v.status =~ /locked/i)} end def stopped? @@ -84,7 +84,7 @@ module Fog end def start(options = {}) - wait_for { stopped? } if options[:blocking] + wait_for { !locked? } if options[:blocking] service.vm_action(:id =>id, :action => :start) reload end