From a4bd3e5ca5ab747fdbf2bd876d7be7a947e74f46 Mon Sep 17 00:00:00 2001 From: Wild Kat Date: Sun, 8 Apr 2018 00:35:47 +0200 Subject: eliminate inverse methods from models --- lib/oxidized/model/aosw.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/oxidized/model/aosw.rb') diff --git a/lib/oxidized/model/aosw.rb b/lib/oxidized/model/aosw.rb index 71fde2e..3397305 100644 --- a/lib/oxidized/model/aosw.rb +++ b/lib/oxidized/model/aosw.rb @@ -40,7 +40,7 @@ class AOSW < Oxidized::Model end cmd 'show version' do |cfg| - cfg = cfg.each_line.select { |line| not line.match /(Switch|AP) uptime/i } + cfg = cfg.each_line.reject { |line| line.match /(Switch|AP) uptime/i } rstrip_cfg comment cfg.join end -- cgit v1.2.1 From 21e3d6490496573f25ef77fe8172766ac7d1a736 Mon Sep 17 00:00:00 2001 From: Wild Kat Date: Sat, 21 Apr 2018 13:27:05 +0200 Subject: the great makeover - standardize layout, alignment, indentation --- lib/oxidized/model/aosw.rb | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'lib/oxidized/model/aosw.rb') diff --git a/lib/oxidized/model/aosw.rb b/lib/oxidized/model/aosw.rb index 3397305..7543353 100644 --- a/lib/oxidized/model/aosw.rb +++ b/lib/oxidized/model/aosw.rb @@ -1,14 +1,13 @@ class AOSW < Oxidized::Model - # AOSW Aruba Wireless, IAP, Instant Controller and Mobility Access Switches # Used in Alcatel OAW-4750 WLAN controller # Also Dell controllers - + # HPE Aruba Switches should use a different model as the software is based on the HP Procurve line. - + # Support for IAP & Instant Controller tested with 115, 205, 215 & 325 running 6.4.4.8-4.2.4.5_57965 # Support for Mobility Access Switches tested with S2500-48P & S2500-24P running 7.4.1.4_54199 and S2500-24P running 7.4.1.7_57823 - # All IAPs connected to a Instant Controller will have the same config output. Only the controller needs to be monitored. + # All IAPs connected to a Instant Controller will have the same config output. Only the controller needs to be monitored. comment '# ' prompt /^\(?.+\)?\s[#>]/ @@ -26,11 +25,11 @@ class AOSW < Oxidized::Model cfg.gsub!(/ sha (\S+)/, ' sha ') cfg.gsub!(/ des (\S+)/, ' des ') cfg.gsub!(/mobility-manager (\S+) user (\S+) (\S+)/, 'mobility-manager \1 user \2 ') - cfg.gsub!(/mgmt-user (\S+) (root|guest\-provisioning|network\-operations|read\-only|location\-api\-mgmt) (\S+)$/, 'mgmt-user \1 \2 ') #MAS & Wireless Controler - cfg.gsub!(/mgmt-user (\S+) (\S+)( (read\-only|guest\-mgmt))?$/, 'mgmt-user \1 \3') #IAP -#MAS format: mgmt-user -#IAP format (root user): mgmt-user -#IAP format: mgmt-user + cfg.gsub!(/mgmt-user (\S+) (root|guest\-provisioning|network\-operations|read\-only|location\-api\-mgmt) (\S+)$/, 'mgmt-user \1 \2 ') # MAS & Wireless Controler + cfg.gsub!(/mgmt-user (\S+) (\S+)( (read\-only|guest\-mgmt))?$/, 'mgmt-user \1 \3') # IAP + # MAS format: mgmt-user + # IAP format (root user): mgmt-user + # IAP format: mgmt-user cfg.gsub!(/key (\S+)$/, 'key ') cfg.gsub!(/wpa-passphrase (\S+)$/, 'wpa-passphrase ') cfg.gsub!(/bkup-passwords (\S+)$/, 'bkup-passwords ') @@ -45,17 +44,17 @@ class AOSW < Oxidized::Model end cmd 'show inventory' do |cfg| - cfg = "" if cfg.match /(Invalid input detected at '\^' marker|Parse error)/ #Don't show for unsupported devices (IAP and MAS) + cfg = "" if cfg.match /(Invalid input detected at '\^' marker|Parse error)/ # Don't show for unsupported devices (IAP and MAS) rstrip_cfg clean cfg end cmd 'show slots' do |cfg| - cfg = "" if cfg.match /(Invalid input detected at '\^' marker|Parse error)/ #Don't show for unsupported devices (IAP and MAS) + cfg = "" if cfg.match /(Invalid input detected at '\^' marker|Parse error)/ # Don't show for unsupported devices (IAP and MAS) rstrip_cfg comment cfg end cmd 'show license' do |cfg| - cfg = "" if cfg.match /(Invalid input detected at '\^' marker|Parse error)/ #Don't show for unsupported devices (IAP and MAS) + cfg = "" if cfg.match /(Invalid input detected at '\^' marker|Parse error)/ # Don't show for unsupported devices (IAP and MAS) rstrip_cfg comment cfg end @@ -112,5 +111,4 @@ class AOSW < Oxidized::Model out = comment out.join "\n" out << "\n" end - end -- cgit v1.2.1