1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

Bug #1344: Handle CLI output of many lines to a pipe

This commit is contained in:
Jaime Melis 2012-07-10 11:59:20 +02:00
parent a3988c2150
commit e9693f8c93

View File

@ -168,13 +168,18 @@ module CLIHelper
def print_data(data, options)
ncolumns=@default_columns.length
res_data=data_array(data, options)
print res_data.collect{|l|
(0..ncolumns-1).collect{ |i|
dat=l[i]
col=@default_columns[i]
format_str(col, dat)
}.join(' ')
}.join("\n")
begin
print res_data.collect{|l|
(0..ncolumns-1).collect{ |i|
dat=l[i]
col=@default_columns[i]
format_str(col, dat)
}.join(' ')
}.join("\n")
rescue Errno::EPIPE
end
puts
end