Skip to content

feat(mikrotik): structured-output parsing base + validation fix (7/10) - #370

Open
WilhelmZA wants to merge 1 commit into
thatmattlove:mainfrom
WilhelmZA:pr/mikrotik-parsing
Open

feat(mikrotik): structured-output parsing base + validation fix (7/10)#370
WilhelmZA wants to merge 1 commit into
thatmattlove:mainfrom
WilhelmZA:pr/mikrotik-parsing

Conversation

@WilhelmZA

@WilhelmZA WilhelmZA commented Jun 13, 2026

Copy link
Copy Markdown

Summary

Adds the shared MikroTik structured-output parsing base used by both structured BGP and structured traceroute:

  • the MikroTik output parser (models/parsing/mikrotik.py),
  • an enhanced garbage-output cleaner that handles routing route print detail and MikroTik's redraw-in-place traceroute table,
  • a target-normalizer input plugin, and
  • registration of mikrotik_routeros / mikrotik_switchos as structured-capable platforms.

Also hardens Device.validate_structured_output: it raised ConfigError with positional arguments (causing a TypeError) instead of the named placeholders the exception expects, so configuring structured_output: true on an unsupported platform now produces the intended ConfigError. Includes a parser unit test built from a real RouterOS 7.x capture.


Stacked series (7/10). Builds on pr/ip-enrichment-service.

Also fixes (MikroTik output handling)

  • Robust MikroTik output cleaning: strips interactive prompts and the flags legend, handles missing fields, and guards against non-string output.
  • Deduplicates MikroTik traceroute output (the table is reprinted per probe cycle / redrawn in place).
  • Populates the route Originator from the MikroTik belongs-to field.

@WilhelmZA
WilhelmZA force-pushed the pr/mikrotik-parsing branch 2 times, most recently from 8e2734d to 44cc277 Compare June 14, 2026 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant