Skip to content

Commit

Permalink
New model for KornfeldOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurenkov Mikhail committed Feb 5, 2025
1 parent 4aa5df8 commit 631b243
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- apc_aos: support for scp (@robertcheramy)
- config: allow model_map and group_map keys to be regexp. Fixes #3360 (@ytti)
- enterprise_sonic: add new model enterprise_sonic (@ohai89)
- model for Kornfeld Operating System(@yurenkov)

### Changed
- sonicos: accept policy message. Fixes #3339 (@Steve-M-C, @robertcheramy)
Expand Down
1 change: 1 addition & 0 deletions docs/Supported-OS-Types.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@
| |NSX Distributed Firewall |[nsxdfw](/lib/oxidized/model/nsxdfw.rb)
|Watchguard |Fireware OS |[firewareos](/lib/oxidized/model/firewareos.rb)
|Westell |Westell 8178G, Westell 8266G |[weos](/lib/oxidized/model/weos.rb)
|Yadro |KornfeldOS |[kornfeldos](/lib/oxidized/model/kornfeldos.rb)
|YAMAHA |YAMAHA NVR/RTX Series |[yamaha](/lib/oxidized/model/yamaha.rb)
|Zhone |Zhone (OLT and MX) |[zhoneolt](/lib/oxidized/model/zhoneolt.rb)
|ZPE |Nodegrid OS |[nodegrid](/lib/oxidized/model/nodegrid.rb)
Expand Down
33 changes: 33 additions & 0 deletions lib/oxidized/model/kornfeldos.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
class KornfeldOS < Oxidized::Model
using Refinements

# For switches running Kornfeld OS
#
# Tested with : Kornfeld D1156 and Kornfeld D2132

comment '# '

cmd :all do |cfg|
cfg.gsub! /^% Invalid input detected at '\^' marker\.$|^\s+\^$/, ''
cfg.each_line.to_a[2..-2].join
end

cmd 'show version | except REPOSITORY | except docker | except Uptime' do |cfg|
comment cfg
end

cmd 'show platform firmware' do |cfg|
comment cfg
end

cmd 'show running-configuration' do |cfg|
cfg.each_line.to_a[0..-1].join
end

cfg :ssh do
username /^Login:/
password /^Password:/
post_login 'terminal length 0'
pre_logout 'exit'
end
end

0 comments on commit 631b243

Please sign in to comment.