summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/timos.rb
diff options
context:
space:
mode:
authorNeil Lathwood <neil@lathwood.co.uk>2018-04-27 10:51:39 +0100
committerNeil Lathwood <neil@lathwood.co.uk>2018-04-27 10:51:39 +0100
commit6574f129bca9633d728c178b12e49a2e9be89cdd (patch)
treea2d630fca3156658aea07469b9a5c3fdf00f6846 /lib/oxidized/model/timos.rb
parentd96cfac1f09ff4055f54ab604358290865d41f62 (diff)
parent34fd5369feee94ab45c5a81d7769b1df717e4c8c (diff)
Rebased from master
Diffstat (limited to 'lib/oxidized/model/timos.rb')
-rw-r--r--lib/oxidized/model/timos.rb120
1 files changed, 6 insertions, 114 deletions
diff --git a/lib/oxidized/model/timos.rb b/lib/oxidized/model/timos.rb
index c230a8f..e454630 100644
--- a/lib/oxidized/model/timos.rb
+++ b/lib/oxidized/model/timos.rb
@@ -1,118 +1,10 @@
-class TiMOS < Oxidized::Model
+# Backward compatibility shim for deprecated model `timos`.
+# Migrate your source from `timos` to `sros`.
- #
- # Nokia SR OS (TiMOS) (formerly TiMetra, Alcatel, Alcatel-Lucent).
- # Used in 7705 SAR, 7210 SAS, 7450 ESS, 7750 SR, 7950 XRS, and NSP.
- #
+require_relative 'sros.rb'
- comment '# '
+TiMOS = SROS
- prompt /^([-\w\.:>\*]+\s?[#>]\s?)$/
+Oxidized.logger.warn "Using deprecated model timos, use sros instead."
- cmd :all do |cfg, cmdstring|
- new_cfg = comment "COMMAND: #{cmdstring}\n"
- new_cfg << cfg.each_line.to_a[1..-2].join
- end
-
- #
- # Show the boot options file.
- #
- cmd 'show bof' do |cfg|
- cfg.gsub! /# Finished .*/, ''
- cfg.gsub! /# Generated .*/, ''
- comment cfg
- end
-
- #
- # Show the system information.
- #
- cmd 'show system information' do |cfg|
- #
- # Strip uptime.
- #
- cfg.sub! /^System Up Time.*\n/, ''
- cfg.gsub! /# Finished .*/, ''
- cfg.gsub! /# Generated .*/, ''
- comment cfg
- end
-
- #
- # Show the card state.
- #
- cmd 'show card state' do |cfg|
- cfg.gsub! /# Finished .*/, ''
- cfg.gsub! /# Generated .*/, ''
- comment cfg
- end
-
- #
- # Show the boot log.
- #
- cmd 'file type bootlog.txt' do |cfg|
- #
- # Strip carriage returns and backspaces.
- #
- cfg.gsub! /\r/, ''
- cfg.gsub! /[\b][\b][\b]/, "\n"
- cfg.gsub! /# Finished .*/, ''
- cfg.gsub! /# Generated .*/, ''
- comment cfg
- end
-
- #
- # Show the running debug configuration.
- #
- cmd 'show debug' do |cfg|
- cfg.gsub! /# Finished .*/, ''
- cfg.gsub! /# Generated .*/, ''
- comment cfg
- end
-
- #
- # Show the saved debug configuration (admin debug-save).
- #
- cmd 'file type config.dbg' do |cfg|
- #
- # Strip carriage returns.
- #
- cfg.gsub! /\r/, ''
- cfg.gsub! /# Finished .*/, ''
- cfg.gsub! /# Generated .*/, ''
- comment cfg
- end
-
- #
- # Show the running persistent indices.
- #
- cmd 'admin display-config index' do |cfg|
- #
- # Strip carriage returns.
- #
- cfg.gsub! /\r/, ''
- cfg.gsub! /# Finished .*/, ''
- cfg.gsub! /# Generated .*/, ''
- comment cfg
- end
-
- #
- # Show the running configuration.
- #
- cmd 'admin display-config' do |cfg|
- #
- # Strip carriage returns.
- #
- cfg.gsub! /\r/, ''
- cfg.gsub! /# Finished .*/, ''
- cfg.gsub! /# Generated .*/, ''
- end
-
- cfg :telnet do
- username /^Login: /
- password /^Password: /
- end
-
- cfg :telnet, :ssh do
- post_login 'environment no more'
- pre_logout 'logout'
- end
-end
+# Deprecated