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

(StoneOS) Prompt support for long device names (>16 chars), '^H' handling and removal of ever-changing data #2707

Merged
merged 1 commit into from
Feb 11, 2023
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 @@ -24,6 +24,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- change pfSense secret scrubbing to keep config as well-formed XML
- Add support for comware HPE Office Connect 1950
- Added model for Hirschmann Hios devices, next to alread present Hirschmann classic (@tijldeneut)
- (StoneOS) Prompt fix for long device names, '^H' handling and removal of ever-changing data (@dMailonG)

### Added

Expand Down
8 changes: 6 additions & 2 deletions lib/oxidized/model/stoneos.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class StoneOS < Oxidized::Model
# Hillstone Networks StoneOS software

prompt /^\r?[\w.()-]+[#>](\s)?$/
prompt /^\r?[\w.()-]+~?[#>](\s)?$/
comment '# '

expect /^\s.*--More--.*$/ do |data, re|
Expand All @@ -10,12 +10,16 @@ class StoneOS < Oxidized::Model
end

cmd :all do |cfg|
cfg.gsub! /+.*+/, '' # Linebreak handling
cfg.cut_both
end

cmd 'show configuration running'
cmd 'show configuration running' do |cfg|
cfg.gsub! /^Building configuration.*$/, ''
end

cmd 'show version' do |cfg|
cfg.gsub! /^Uptime is .*$/, ''
comment cfg
end

Expand Down