diff options
author | Reinier Schoof <reinier@skoef.nl> | 2015-09-28 09:40:16 +0200 |
---|---|---|
committer | Reinier Schoof <reinier@skoef.nl> | 2015-09-28 09:40:16 +0200 |
commit | dbaa0aa77d4420f660262222cbcf99fa3e3cbf4e (patch) | |
tree | 8919480bf00a7768966d3bd20e9c9b57dcb8b294 | |
parent | bf999706f0be794563b78fb90999b5c5fa8e54d5 (diff) | |
parent | 073a1bb7e569ed07214249a6b200d310be29709f (diff) |
Merge remote-tracking branch 'ytti/master'
Conflicts:
lib/oxidized/model/ironware.rb
-rw-r--r-- | lib/oxidized/model/asa.rb | 8 | ||||
-rw-r--r-- | lib/oxidized/model/ironware.rb | 11 | ||||
-rw-r--r-- | lib/oxidized/model/xos.rb | 4 |
3 files changed, 13 insertions, 10 deletions
diff --git a/lib/oxidized/model/asa.rb b/lib/oxidized/model/asa.rb index d257e9e..547afd7 100644 --- a/lib/oxidized/model/asa.rb +++ b/lib/oxidized/model/asa.rb @@ -23,16 +23,16 @@ class ASA < Oxidized::Model comment cfg end + cmd 'show inventory' do |cfg| + comment cfg + end + cmd 'more system:running-config' do |cfg| cfg = cfg.each_line.to_a[3..-1].join cfg.gsub! /^: [^\n]*\n/, '' cfg end - cmd 'show inventory' do |cfg| - comment cfg - end - cfg :ssh do if vars :enable post_login do diff --git a/lib/oxidized/model/ironware.rb b/lib/oxidized/model/ironware.rb index 870d45a..2975651 100644 --- a/lib/oxidized/model/ironware.rb +++ b/lib/oxidized/model/ironware.rb @@ -19,11 +19,6 @@ class IronWare < Oxidized::Model cfg.each_line.to_a[1..-2].join end - cmd 'show running-config' do |cfg| - arr = cfg.each_line.to_a - arr[3..-1].join unless arr.length < 3 - end - cmd 'show version' do |cfg| cfg.gsub! /(^((.*)[Ss]ystem uptime(.*))$)/, '' #remove unwanted line system uptime cfg.gsub! /[Uu]p\s?[Tt]ime is .*/,'' @@ -55,9 +50,15 @@ class IronWare < Oxidized::Model end cmd 'show module' do |cfg| + cfg.gsub! /^((Invalid input)|(Type \?)).*$/, '' # some ironware devices are fixed config comment cfg end + cmd 'show running-config' do |cfg| + arr = cfg.each_line.to_a + arr[3..-1].join unless arr.length < 3 + end + cfg :telnet do # match expected prompts on both older and newer # versions of IronWare diff --git a/lib/oxidized/model/xos.rb b/lib/oxidized/model/xos.rb index 309340f..e4a1ed4 100644 --- a/lib/oxidized/model/xos.rb +++ b/lib/oxidized/model/xos.rb @@ -6,7 +6,9 @@ class XOS < Oxidized::Model comment '# ' cmd :all do |cfg| - cfg.each_line.to_a[1..-2].join + # xos inserts leading \r characters and other trailing white space. + # this deletes extraneous \r and trailing white space. + cfg.each_line.to_a[1..-2].map{|line|line.delete("\r").rstrip}.join("\n") + "\n" end cmd 'show version' do |cfg| |