Arthur Clement
2010-Sep-01 14:19 UTC
[Ovirt-devel] [PATCH 2/2] Adding the ability to select a Host to start a VM [2/2]
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
Arthur Clément
2010-Sep-01 14:21 UTC
[Ovirt-devel] [PATCH 2/2] Adding the ability to select a Host to start a VM [2/2]
Pushed On mercredi 01 septembre 2010 16:19:22 Arthur Clement wrote:> 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)-- Arthur CLEMENT Linagora Paris