Skip to content

Commit 47dfeaf

Browse files
Merge pull request ytti#3856 from ytti/fix/3846-fortigate-prompt
Fix fortigate 7.6.7 prompt for HA Status
2 parents 7e3ea6d + 87355fd commit 47dfeaf

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
1414
### Fixed
1515
- siklu: allow parenthesis in prompt. Fixes #3841 (@ytti)
1616
- fortios: allow parenthesis in prompt. Fixes #3846 (@ytti)
17-
- fortigate: make space before parenthesis optional. Fixes #3846 (@ytti)
17+
- fortigate: prompt can contain HA cluster status. Fixes #3846 (@robertcheramy)
1818

1919
## [0.37.0 - 2026-05-20]
2020
### Added

lib/oxidized/model/fortigate.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@ class FortiGate < Oxidized::Model
33

44
comment '# '
55

6-
prompt /^(\(\w\) )?([-\w.~]+(\s?[(\w\-.)]+)?~?\s?[#>$]\s?)$/
7-
6+
prompt(/
7+
^
8+
(?:\(\w\)\ )? # optional status indicator, e.g. "(M) "
9+
[-\w.~]+ # hostname
10+
(?:\((?:\w+)\))? # optional HA cluster status (Primary|Secondary)
11+
(?:\ [(\w\-.)]+)? # optional VDOM
12+
~?\ ?[#>$]\ ?$ # End of prompt
13+
/x)
814
# When a post-login-banner is enabled, you have to press "a" to log in
915
expect /^\(Press\s'a'\sto\saccept\):/ do |data, re|
1016
send 'a'

spec/model/data/fortigate#generic#prompt.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ pass:
88
- 'OXI-FW121 (global) # '
99
# Issue #3846
1010
- 'hostname(Primary) # '
11+
- 'hostname(Primary) (global) # '
12+

0 commit comments

Comments
 (0)