diff --git a/src/cli/one_helper/onevm_helper.rb b/src/cli/one_helper/onevm_helper.rb index c54b49e7c7..142fa2fca8 100644 --- a/src/cli/one_helper/onevm_helper.rb +++ b/src/cli/one_helper/onevm_helper.rb @@ -681,13 +681,13 @@ class OneVMHelper < OpenNebulaHelper::OneHelper str_h1 = '%-80s' str = "%-20s: %-#{max_value}s" - trunc = lambda do |str, max = max_value| - return '' unless str + trunc = lambda do |tvalue, max = max_value| + return '' unless tvalue - if str.length > max - str[0, max_value - 3] + '...' + if tvalue.length > max + tvalue[0, max - 3] + '...' else - str + tvalue end end