Skip to content

Commit

Permalink
dix sonicos prompt for hostnames containing "-"
Browse files Browse the repository at this point in the history
Fixes #3333
  • Loading branch information
robertcheramy committed Dec 6, 2024
1 parent 37ae366 commit de6b5fd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
### Fixed
- tplink: send 'enable' before the enable password. Fixes #3271 (@robertcheramy)
- asyncos: fix prompt for hostnames containing "-" . Fixes #3327 (@robertcheramy)
- sonicos: fix prompt for hostnames containing "-" . Fixes #3333 (@robertcheramy)


## [0.31.0 – 2024-11-29]
Expand Down
2 changes: 1 addition & 1 deletion lib/oxidized/model/sonicos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class SonicOS < Oxidized::Model

# Applies to Sonicwall NSA series firewalls

prompt /^\w+@\w+[>]\(?.+\)?\s?/
prompt /^\w+@[\w\-]+[>]\(?.+\)?\s?/
comment '! '

cmd :all do |cfg|
Expand Down
16 changes: 16 additions & 0 deletions spec/model/sonicwall_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require_relative 'model_helper'

describe 'model/SonicOS' do
before(:each) do
init_model_helper
@node = Oxidized::Node.new(name: 'example.com',
input: 'ssh',
model: 'sonicos')
end

it 'matches different prompts' do
_('admin@012345> ').must_match SonicOS.prompt
# Issue #3333
_('admin@host-with-minus> ').must_match SonicOS.prompt
end
end

0 comments on commit de6b5fd

Please sign in to comment.