diff options
Diffstat (limited to 'lib/oxidized/model/ironware.rb')
-rw-r--r-- | lib/oxidized/model/ironware.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/oxidized/model/ironware.rb b/lib/oxidized/model/ironware.rb index 2975651..87a51a6 100644 --- a/lib/oxidized/model/ironware.rb +++ b/lib/oxidized/model/ironware.rb @@ -16,7 +16,9 @@ class IronWare < Oxidized::Model #end cmd :all do |cfg| - cfg.each_line.to_a[1..-2].join + # sometimes ironware inserts arbitrary whitespace after commands are + # issued on the CLI, from run to run. this normalises the output. + cfg.each_line.to_a[1..-2].drop_while { |e| e.match /^\s+$/ }.join end cmd 'show version' do |cfg| @@ -56,7 +58,7 @@ class IronWare < Oxidized::Model cmd 'show running-config' do |cfg| arr = cfg.each_line.to_a - arr[3..-1].join unless arr.length < 3 + arr[2..-1].join unless arr.length < 2 end cfg :telnet do |