Skip to content

Commit

Permalink
(StoneOS) Prompt support for long device names (>16 chars), '^H' (#2707)
Browse files Browse the repository at this point in the history
handling and removal of ever-changing data (@dMailonG)
  • Loading branch information
dMailonG committed Feb 11, 2023
1 parent aa23e5f commit ebe4cfa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
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

0 comments on commit ebe4cfa

Please sign in to comment.