-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Labels
v4-enhancementEnhancement planned for hier_config v4.0.0Enhancement planned for hier_config v4.0.0
Description
Description
Two bugs in the Fortinet FortiOS driver:
1. swap_negation() drops parameters (driver.py:47)
child.text = f"{self.negation_prefix}{child.text.removeprefix(self.declaration_prefix).split()[0]}".split()[0] keeps only the first word after the prefix, dropping all parameters:
- Input:
set description "Port 1"→unset description(drops"Port 1")
2. idempotent_for() IndexError (driver.py:61)
config.text.split()[1] == other_child.text.split()[1]No bounds check — crashes with IndexError on single-word commands (e.g., bare set).
Proposed Fix
- Preserve full command text in
swap_negation()(like VyOS driver does) - Add bounds check before
.split()[1]access
These should ideally be addressed alongside #220 (unified negation rules) and #222 (declarative-only drivers) in v4.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
v4-enhancementEnhancement planned for hier_config v4.0.0Enhancement planned for hier_config v4.0.0