Skip to content

Conversation

@GigleGig
Copy link

@GigleGig GigleGig commented Oct 3, 2025

Test inclusion requirements

No new tests were added; this patch simply hardens the existing Junos cleaners. Verified with:
CONDA_NO_PLUGINS=true conda run -n suzieq pytest tests/unit/poller/worker/services/test_service.py

Related Issue

Fixes #991

Description

SRX5600 devices (detected as junos-es) return multi-routing-engine JSON and sometimes emit lists/None in interface and ARP data. The poller expected MX-style JSON and scalar fields, so it raised KeyError, AttributeError, and TypeError while cleaning. This change reuses the QFX normalizer for junos-es, normalises interface type values, and guards ARP entries without oif, allowing SRX firewalls to be parsed successfully.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

New Behavior

  • junos-es devices pull the QFX command/normalisation set, matching SRX multi-RE uptime output.
  • Junos interface cleaner now flattens list/dict type fields before lowercasing.
  • Junos ARP/ND cleaner tolerates missing oif values, defaulting to an empty string.

Contrast to Current Behavior

  • Previously, SRX polling crashed on bootup timestamp extraction, interface type cleaning, and ARP entries with missing oif.

Discussion: Benefits and Drawbacks

  • Benefits: Enables SRX/junos-es polling without errors; retains existing behaviour for other Junos platforms.
  • Drawbacks: None identified; changes are backward-compatible.

Changes to the Documentation

  • None required.

Proposed Release Note Entry

  • Fix SRX (junos-es) poller crashes by aligning JSON normalisation and handling missing interface/ARP fields.

Comments

  • Tests executed: CONDA_NO_PLUGINS=true conda run -n suzieq pytest tests/unit/poller/worker/services/test_service.py

Double Check

  • I have read the comments and followed the CONTRIBUTING.md.
  • I have explained my PR according to the information in the comments or in a linked issue.
  • My PR source branch is created from the develop branch.
  • My PR targets the develop branch.
  • All my commits have --signoff applied

Signed-off-by: SuzieQ Bot <bot@suzieq>
Signed-off-by: GigleGig <[email protected]>
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.

[Bug]: Junos SRX5600 as devtype=junos-es

1 participant