[Ovirt-devel] [PATCH 2/2] Adding the ability to select a Host to start a VM [2/2]

Arthur Clement aclement at linagora.com
Wed Sep 1 14:19:22 UTC 2010


Signed-off-by: Simon Courtois <scourtois at linagora.com>
---
 src/task-omatic/taskomatic.rb |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb
index 471ec88..1dfd74f 100755
--- a/src/task-omatic/taskomatic.rb
+++ b/src/task-omatic/taskomatic.rb
@@ -355,11 +355,10 @@ class TaskOmatic
       end
     end
 
-    if task.args
+    if task.args && !task.args.blank?
       db_host = db_vm.vm_resource_pool.get_hardware_pool.hosts.find(task.args)
-    else
-      db_host = find_capable_host(db_vm)
     end
+    db_host ||= find_capable_host(db_vm)
 
     node = @qmfc.object(:class => "node", 'hostname' => db_host.hostname)
 
-- 
1.7.2.2




More information about the ovirt-devel mailing list