summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/slxos.rb
diff options
context:
space:
mode:
authorRon <rgnv@users.noreply.github.com>2018-04-27 06:24:56 -0700
committerGitHub <noreply@github.com>2018-04-27 06:24:56 -0700
commit2bb40ad4d9e31cf2cd63a373f7c607eb86547e46 (patch)
treec12b52f0acd5192c457fa07189c4946674cd11fb /lib/oxidized/model/slxos.rb
parentec90b081f0fed05497ce6ae21e4b4ba4d44ecc01 (diff)
parent83a00943d7333fafdfe352173713a22a5ac89f6f (diff)
Merge pull request #1 from wk/pr-1280
massage into rubocop compliance
Diffstat (limited to 'lib/oxidized/model/slxos.rb')
-rw-r--r--lib/oxidized/model/slxos.rb26
1 files changed, 12 insertions, 14 deletions
diff --git a/lib/oxidized/model/slxos.rb b/lib/oxidized/model/slxos.rb
index 934da5b..1afc8b1 100644
--- a/lib/oxidized/model/slxos.rb
+++ b/lib/oxidized/model/slxos.rb
@@ -1,35 +1,34 @@
class SLXOS < Oxidized::Model
-
prompt /^.*[>#]\s?$/i
- comment '! '
+ comment '! '
cmd 'show version' do |cfg|
- cfg.gsub! /(^((.*)[Ss]ystem [Uu]ptime(.*))$)/, '' #remove unwanted line system uptime
- cfg.gsub! /[Uu]p\s?[Tt]ime is .*/,''
+ cfg.gsub! /(^((.*)[Ss]ystem [Uu]ptime(.*))$)/, '' # remove unwanted line system uptime
+ cfg.gsub! /[Uu]p\s?[Tt]ime is .*/, ''
comment cfg
end
cmd 'show chassis' do |cfg|
- cfg.encode!("UTF-8", :invalid => :replace, :undef => :replace) #sometimes ironware returns broken encoding
- cfg.gsub! /.*Power Usage.*/, '' #remove unwanted lines power usage
- cfg.gsub! /Time A(live|wake).*/, '' #remove unwanted lines time alive/awake
+ cfg.encode!("UTF-8", :invalid => :replace, :undef => :replace) # sometimes ironware returns broken encoding
+ cfg.gsub! /.*Power Usage.*/, '' # remove unwanted lines power usage
+ cfg.gsub! /Time A(live|wake).*/, '' # remove unwanted lines time alive/awake
cfg.gsub! /([\[]*)1([\]]*)<->([\[]*)2([\]]*)(<->([\[]*)3([\]]*))*/, ''
comment cfg
end
cmd 'show system' do |cfg|
- cfg.gsub! /Up Time.*/, '' #removes uptime line
- cfg.gsub! /Current Time.*/, '' #remove current time line
- cfg.gsub! /.*speed is.*/, '' #removes fan speed lines
+ cfg.gsub! /Up Time.*/, '' # removes uptime line
+ cfg.gsub! /Current Time.*/, '' # remove current time line
+ cfg.gsub! /.*speed is.*/, '' # removes fan speed lines
comment cfg
end
cmd 'show slots' do |cfg|
cfg.gsub! /^-*^$/, '' # some slx devices are fixed config
- cfg.gsub! /syntax error: element does not exist/, '' # same as above
+ cfg.gsub! /syntax error: element does not exist/, '' # same as above
comment cfg
end
@@ -45,7 +44,7 @@ class SLXOS < Oxidized::Model
password /^(Please Enter Password ?|Password):/
end
- #handle pager with enable
+ # handle pager with enable
cfg :telnet, :ssh do
if vars :enable
post_login do
@@ -55,7 +54,6 @@ class SLXOS < Oxidized::Model
end
post_login ''
post_login 'terminal length 0'
- pre_logout 'exit'
+ pre_logout 'exit'
end
-
end