Refactor Mikrotik model and update TTP template for improved configuration handling

- Removed unused imports and main execution block from the Mikrotik model for cleaner code.
- Updated the Mikrotik TTP template to adjust the order of parameters in the 'add' command, enhancing clarity in the generated configurations.
- Added a new configuration file `config.conf` for Mikrotik devices to facilitate testing and validation of parsing functionality.
This commit is contained in:
IluaAir
2026-06-07 09:06:24 +03:00
parent a617bd6ecd
commit 2ea056aa17
3 changed files with 124 additions and 10 deletions

View File

@@ -42,6 +42,6 @@ add comment={{ comment | _start_ | ORPHRASE | exclude("disabled=") | strip('"')}
## disabled with comment with/without quotes
add comment={{ comment | _start_ | ORPHRASE | exclude("disabled=") | strip('"')}} disabled={{ disabled | replace("yes","True") | strip('"') }} interface={{ interface }} name={{ name | ORPHRASE | strip('"') }} vlan-id={{ vlan_id }}
## disabled no comment
add interface={{ interface | _start_ }} name={{ name | ORPHRASE | strip('"') }} vlan-id={{ vlan_id }} disabled={{ disabled | replace("yes","True") | strip('"') }}
add disabled={{ disabled | _start_ | replace("yes","True") | strip('"') }} interface={{ interface }} name={{ name | ORPHRASE | strip('"') }} vlan-id={{ vlan_id }}
</group>