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/acos.rb | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'lib/oxidized/model/acos.rb') diff --git a/lib/oxidized/model/acos.rb b/lib/oxidized/model/acos.rb index 47649a2..a2db89c 100644 --- a/lib/oxidized/model/acos.rb +++ b/lib/oxidized/model/acos.rb @@ -3,7 +3,7 @@ class ACOS < Oxidized::Model comment '! ' - ##ACOS prompt changes depending on the state of the device + # ACOS prompt changes depending on the state of the device prompt /^([-\w.\/:?\[\]\(\)]+[#>]\s?)$/ cmd :secret do |cfg| @@ -30,19 +30,19 @@ class ACOS < Oxidized::Model end cmd 'show partition-config all' do |cfg| - cfg.gsub! /(Current configuration).*/, '\\1 ' - cfg.gsub! /(Configuration last updated at).*/, '\\1 ' - cfg.gsub! /(Configuration last saved at).*/, '\\1 ' - cfg.gsub! /(Configuration last synchronized at).*/, '\\1 ' - cfg - end + cfg.gsub! /(Current configuration).*/, '\\1 ' + cfg.gsub! /(Configuration last updated at).*/, '\\1 ' + cfg.gsub! /(Configuration last saved at).*/, '\\1 ' + cfg.gsub! /(Configuration last synchronized at).*/, '\\1 ' + cfg + end cmd 'show running-config all-partitions' do |cfg| - cfg.gsub! /(Current configuration).*/, '\\1 ' - cfg.gsub! /(Configuration last updated at).*/, '\\1 ' - cfg.gsub! /(Configuration last saved at).*/, '\\1 ' - cfg.gsub! /(Configuration last synchronized at).*/, '\\1 ' - cfg + cfg.gsub! /(Current configuration).*/, '\\1 ' + cfg.gsub! /(Configuration last updated at).*/, '\\1 ' + cfg.gsub! /(Configuration last saved at).*/, '\\1 ' + cfg.gsub! /(Configuration last synchronized at).*/, '\\1 ' + cfg end cmd 'show aflex all-partitions' do |cfg| @@ -50,7 +50,7 @@ class ACOS < Oxidized::Model end cmd 'show aflex all-partitions' do |cfg| - @partitions_aflex = cfg.lines.each_with_object({}) do |l,h| + @partitions_aflex = cfg.lines.each_with_object({}) do |l, h| h[$1] = [] if l.match /partition: (.+)/ # only consider scripts that have passed syntax check h[h.keys.last] << $1 if l.match /^([\w-]+) +Check/ @@ -66,7 +66,7 @@ class ACOS < Oxidized::Model pre do unless @partitions_aflex.empty? out = [] - @partitions_aflex.each do |partition,arules| + @partitions_aflex.each do |partition, arules| out << "! partition: #{partition}" arules.each do |name| cmd("show aflex #{name} partition #{partition}") do |cfg| @@ -85,7 +85,7 @@ class ACOS < Oxidized::Model username /login:/ password /^Password:/ end - + cfg :telnet, :ssh do # preferred way to handle additional passwords post_login do @@ -98,5 +98,4 @@ class ACOS < Oxidized::Model post_login 'terminal width 0' pre_logout "exit\nexit\nY\r\n" end - end -- cgit v1.2.1