From d6cfb50606f3ee96610efb1eb85863c1a3dfe034 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 28 Jan 2014 13:18:19 +0100 Subject: [PATCH 1/4] Update comments of kvm.conf file to include RAW behavior --- src/vmm_mad/exec/vmm_exec_kvm.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vmm_mad/exec/vmm_exec_kvm.conf b/src/vmm_mad/exec/vmm_exec_kvm.conf index 8cf0b39f53..4f3bb432da 100644 --- a/src/vmm_mad/exec/vmm_exec_kvm.conf +++ b/src/vmm_mad/exec/vmm_exec_kvm.conf @@ -24,6 +24,7 @@ # - disk [driver, cache, io] # - nic [filter, model] # - raw +# NOTE: raw attribute value is appended to that on the VM template #EMULATOR = /usr/libexec/qemu-kvm From e3d868e36aafbdf5eb5987c9aef50e68a72de7c2 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Tue, 28 Jan 2014 15:59:45 +0100 Subject: [PATCH 2/4] feature #2371: fix bug returning errors from get_hash --- src/cli/one_helper.rb | 14 +++++++------- src/oca/ruby/opennebula/pool.rb | 5 ++++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/cli/one_helper.rb b/src/cli/one_helper.rb index 16cb97d67c..299a38face 100644 --- a/src/cli/one_helper.rb +++ b/src/cli/one_helper.rb @@ -367,17 +367,17 @@ EOT if top table.top(options) { - array=pool_to_array(pool.get_hash) - if OpenNebula.is_error?(array) - STDERR.puts array.mesage - exit(-1) - end - array + array=pool.get_hash + return -1, array.message if OpenNebula.is_error?(array) + + pool_to_array(array) } else - array=pool_to_array(pool.get_hash) + array=pool.get_hash return -1, array.message if OpenNebula.is_error?(array) + array=pool_to_array(array) + if options[:ids] array=array.select do |element| options[:ids].include? element['ID'].to_i diff --git a/src/oca/ruby/opennebula/pool.rb b/src/oca/ruby/opennebula/pool.rb index 340dbee00c..6c4e0b4a17 100644 --- a/src/oca/ruby/opennebula/pool.rb +++ b/src/oca/ruby/opennebula/pool.rb @@ -175,7 +175,10 @@ module OpenNebula if OpenNebula.pool_page_size && allow_paginated && ( ( size && size >= 2 ) || !size ) size = OpenNebula.pool_page_size if !size - { @pool_name => { @element_name => info_paginated(size) } } + hash=info_paginated(size) + + return hash if OpenNebula.is_error?(hash) + { @pool_name => { @element_name => hash } } else rc=info return rc if OpenNebula.is_error?(rc) From 8c678b8f84839159f84c3dcc9c4602e9541dc78e Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Tue, 28 Jan 2014 16:32:45 +0100 Subject: [PATCH 3/4] feature #2371: do not print extra line in list commands --- src/cli/cli_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/cli_helper.rb b/src/cli/cli_helper.rb index 5034b8b3a5..a4c8af55b5 100644 --- a/src/cli/cli_helper.rb +++ b/src/cli/cli_helper.rb @@ -217,7 +217,7 @@ module CLIHelper begin res_data.each{|l| - puts (0..ncolumns-1).collect{ |i| + print (0..ncolumns-1).collect{ |i| dat=l[i] col=@default_columns[i] From db2790e9756ba6f84ed7ed61c1a9cb14277411aa Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Tue, 28 Jan 2014 17:14:45 +0100 Subject: [PATCH 4/4] feature #2371: better fix for the extra new line in list --- src/cli/cli_helper.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/cli/cli_helper.rb b/src/cli/cli_helper.rb index a4c8af55b5..96f0b632b4 100644 --- a/src/cli/cli_helper.rb +++ b/src/cli/cli_helper.rb @@ -217,7 +217,7 @@ module CLIHelper begin res_data.each{|l| - print (0..ncolumns-1).collect{ |i| + puts (0..ncolumns-1).collect{ |i| dat=l[i] col=@default_columns[i] @@ -229,8 +229,6 @@ module CLIHelper } rescue Errno::EPIPE end - - puts end def data_array(data, options)