Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New model for KornfeldOS #3387

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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