summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/planet.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oxidized/model/planet.rb')
-rw-r--r--lib/oxidized/model/planet.rb20
1 files changed, 8 insertions, 12 deletions
diff --git a/lib/oxidized/model/planet.rb b/lib/oxidized/model/planet.rb
index 9ce9cf9..56e688c 100644
--- a/lib/oxidized/model/planet.rb
+++ b/lib/oxidized/model/planet.rb
@@ -1,24 +1,23 @@
class Planet < Oxidized::Model
-
prompt /^\r?([\w.@()-]+[#>]\s?)$/
comment '! '
# example how to handle pager
- #expect /^\s--More--\s+.*$/ do |data, re|
+ # expect /^\s--More--\s+.*$/ do |data, re|
# send ' '
# data.sub re, ''
- #end
+ # end
# non-preferred way to handle additional PW prompt
- #expect /^[\w.]+>$/ do |data|
+ # expect /^[\w.]+>$/ do |data|
# send "enable\n"
# send vars(:enable) + "\n"
# data
- #end
+ # end
cmd :all do |cfg|
- #cfg.gsub! /\cH+\s{8}/, '' # example how to handle pager
- #cfg.gsub! /\cH+/, '' # example how to handle pager
+ # cfg.gsub! /\cH+\s{8}/, '' # example how to handle pager
+ # cfg.gsub! /\cH+/, '' # example how to handle pager
cfg.each_line.to_a[1..-2].join
end
@@ -39,7 +38,7 @@ class Planet < Oxidized::Model
cfg = cfg.each_line.to_a[0...-2]
- # Strip system (up)time and temperature
+ # Strip system (up)time and temperature
cfg = cfg.reject { |line| line.match /System Time\s*:.*/ }
cfg = cfg.reject { |line| line.match /System Uptime\s*:.*/ }
cfg = cfg.reject { |line| line.match /Temperature\s*:.*/ }
@@ -47,13 +46,12 @@ class Planet < Oxidized::Model
comment cfg.join
end
-
cmd 'show running-config' do |cfg|
cfg.gsub! "\n\r", "\n"
cfg = cfg.each_line.to_a
cfg = cfg.reject { |line| line.match "Building configuration..." }
-
+
if @planetsgs
cfg << cmd('show transceiver detail | include transceiver detail information|found|Type|length|Nominal|wavelength|Base information') do |cfg|
comment cfg
@@ -62,7 +60,6 @@ class Planet < Oxidized::Model
cfg.join
end
-
cfg :telnet do
username /^Username:/
@@ -80,5 +77,4 @@ class Planet < Oxidized::Model
end
pre_logout 'exit'
end
-
end