Skip to content

feat(device-discovery): vrf discovery for extreme_slx, dell_ftos, brocade_netiron, extreme_vsp#456

Merged
leoparente merged 6 commits into
developfrom
feat/device-discovery-vrf-drivers-batch4
Jun 11, 2026
Merged

feat(device-discovery): vrf discovery for extreme_slx, dell_ftos, brocade_netiron, extreme_vsp#456
leoparente merged 6 commits into
developfrom
feat/device-discovery-vrf-drivers-batch4

Conversation

@leoparente

Copy link
Copy Markdown
Contributor

Summary

Final custom-driver batch implementing get_network_instances() for VRF discovery (follows #452/#453/#454/#455). This completes the planned driver coverage: 22 drivers now support options.discover_vrfs; everything else is documented as permanently-N/A or demand-driven.

Per driver

Driver Data source Notes
extreme_slx Vrf column of show ip interface brief (ntc-template) The fixture is the upstream real-device capture. Same rows IP discovery parses, so member names join exactly. default-vrf = global table; mgmt-vrf kept. Management rows pre-stripped (template error-exits on them, mirroring the IP getter). Membership-derived enumeration; RD not collected.
dell_ftos show ip vrf, driver-local parse Abbreviated members (Gi 1/2) expand to the full template forms interface discovery keys by — including OS9's lowercase-first speed names (fortyGigE). Wrapped continuation lines, trailing-number ranges (cross-slot ranges deliberately not expanded), paging-orphan continuations dropped. default (id 0) = global table; management (511) kept.
brocade_netiron show vrf, driver-local parse Default RD carried ((null)/Not Set sentinels → absent); member shorthand (ve2, e1/1) canonicalised through the driver's existing bare-id name map so names join get_interfaces() output. default-vrf = global table.
extreme_vsp show ip vrf + per-VRF show ip interface vrf <name> Members parsed with the same row parser the IP getter uses. GlobalRouter = global table; MgmtRouter kept.

Validation caveat — stated plainly

extreme_slx is grounded in a real capture. dell_ftos, brocade_netiron, and extreme_vsp are built from vendor-documented output formats — mockit and ntc-templates carry no VRF command captures for these platforms. Each is marked in code and docs as needing live-device validation; parsers are deliberately conservative (unparseable tokens pass through and simply never join rather than guessing).

Tests

  • 8 fixture scenarios; driver ownership pin matrix now 22 drivers
  • Full suite: 1786 passed, 161 skipped; ruff clean

Review trail

Two adversarial Claude rounds. Round 1 caught a HIGH (FTOS abbreviated member names provably could never join the driver's own full-name interface keys — the feature would have silently no-op'd on every OS9 box) plus NetIron Not Set RD dropping whole VRF rows, cross-slot range fabrication, and stale-continuation attachment — all fixed with probes. Round 2: APPROVED, with its remaining LOW/INFO hardenings (OS9 lowercase speed casing, phantom-VRF orphan drop, NotSet sentinel) also applied. A codex final-gate pass was started but stopped for time; the two-round adversarial trail stands as the quality gate.

🤖 Generated with Claude Code

…cade_netiron, extreme_vsp

Final custom-driver batch implementing get_network_instances():

- extreme_slx: VRF membership from the Vrf column of "show ip
  interface brief" (the extreme_slxos ntc-template, validated against
  the upstream real-device capture), the same rows the IP getter
  consumes. default-vrf is the global table; mgmt-vrf is kept.
  Management rows are pre-stripped like the IP getter does.
- dell_ftos: driver-local parse of "show ip vrf" — abbreviated
  comma-separated members with wrapped continuation lines and
  trailing-number ranges (Gi 1/3-1/5) expanded; continuation lines are
  discriminated from rows by being member-tokens-only. default (id 0)
  is the global table; management (id 511) is kept.
- brocade_netiron: driver-local parse of "show vrf" (name, default
  RD with (null) sentinel handling, wrapped member lists); member
  shorthand (ve2, e1/1) canonicalised through the same bare-id map
  get_interfaces_vlans() uses so names join get_interfaces() output.
- extreme_vsp: "show ip vrf" enumerates VRFs; one "show ip interface
  vrf <name>" per VRF lists members via the same row parser the IP
  getter uses. GlobalRouter is the global table; MgmtRouter is kept.

SLX is grounded in a real capture; the other three are built from
vendor-documented formats and marked as needing live-device validation
in code and docs. Eight fixture scenarios; pin matrix now 22 drivers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

Coverage

Coverage Report
FileStmtsMissCoverMissing
device_discovery
   client.py661085%169–188
   discovery.py76593%102–104, 174–177
   entity_metadata.py13285%24, 27
   interface.py217598%141–145, 491–492
   main.py49296%182, 188
   metrics.py53198%133
   server.py881089%44–46, 72–87, 184, 187
   stubs.py1601094%31, 64, 84, 146, 256, 301, 324–329, 341–346
   translate.py283798%141, 143, 256, 478, 556, 567, 608
   translate_chassis.py175697%42, 45, 54–55, 149, 405
   translate_modules.py107199%217
   version.py7186%14
   vrf.py72396%67–68, 99
device_discovery/policy
   manager.py61395%37–38, 161
   portscan.py841187%34–35, 59–60, 64, 72–76, 117
   run.py88298%158, 193
   runner.py2532391%276–280, 285–286, 303–304, 397, 631, 650–682
TOTAL198810295% 

Tests Skipped Failures Errors Time
1948 161 💤 0 ❌ 0 🔥 24.912s ⏱️

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 860b70a5f9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread device-discovery/custom_napalm/extreme_slx.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements get_network_instances() (NAPALM OpenConfig network-instances shape) for the final batch of custom drivers to support opt-in VRF discovery via options.discover_vrfs, and adds fixtures/tests to pin behavior for each platform’s CLI output.

Changes:

  • Added get_network_instances() implementations for extreme_slx, dell_ftos, brocade_netiron, and extreme_vsp.
  • Added per-driver mock CLI captures + expected results for “normal” and “no_vrfs” scenarios.
  • Extended the VRF-dispatch runner test matrix to include the four newly-supported drivers.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
device-discovery/tests/test_runner_vrf_dispatch.py Expands the pinned support matrix to include the four new VRF-capable drivers.
device-discovery/tests/custom_drivers/extreme_vsp/mock_data/test_get_network_instances/normal/show_ip_vrf.txt Fixture for VSP VRF enumeration output.
device-discovery/tests/custom_drivers/extreme_vsp/mock_data/test_get_network_instances/normal/show_ip_interface_vrf_vrf-red.txt Fixture for per-VRF interface membership (vrf-red).
device-discovery/tests/custom_drivers/extreme_vsp/mock_data/test_get_network_instances/normal/show_ip_interface_vrf_MgmtRouter.txt Fixture for per-VRF interface membership (MgmtRouter).
device-discovery/tests/custom_drivers/extreme_vsp/mock_data/test_get_network_instances/normal/expected_result.json Expected get_network_instances() result for VSP “normal” case.
device-discovery/tests/custom_drivers/extreme_vsp/mock_data/test_get_network_instances/no_vrfs/expected_result.json Expected get_network_instances() result for VSP “no_vrfs” case.
device-discovery/tests/custom_drivers/extreme_slx/mock_data/test_get_network_instances/normal/show_ip_interface_brief.txt Fixture for SLX VRF membership derived from show ip interface brief.
device-discovery/tests/custom_drivers/extreme_slx/mock_data/test_get_network_instances/normal/expected_result.json Expected get_network_instances() result for SLX “normal” case.
device-discovery/tests/custom_drivers/extreme_slx/mock_data/test_get_network_instances/no_vrfs/expected_result.json Expected get_network_instances() result for SLX “no_vrfs” case.
device-discovery/tests/custom_drivers/dell_ftos/mock_data/test_get_network_instances/normal/show_ip_vrf.txt Fixture for OS9 show ip vrf output (wrapped members / ranges).
device-discovery/tests/custom_drivers/dell_ftos/mock_data/test_get_network_instances/normal/expected_result.json Expected get_network_instances() result for FTOS “normal” case.
device-discovery/tests/custom_drivers/dell_ftos/mock_data/test_get_network_instances/no_vrfs/expected_result.json Expected get_network_instances() result for FTOS “no_vrfs” case.
device-discovery/tests/custom_drivers/brocade_netiron/mock_data/test_get_network_instances/normal/show_vrf.txt Fixture for NetIron show vrf output (with wrapped interface list).
device-discovery/tests/custom_drivers/brocade_netiron/mock_data/test_get_network_instances/normal/show_interfaces.txt Fixture backing canonical interface-name mapping for NetIron member normalization.
device-discovery/tests/custom_drivers/brocade_netiron/mock_data/test_get_network_instances/normal/expected_result.json Expected get_network_instances() result for NetIron “normal” case (incl. RD handling).
device-discovery/tests/custom_drivers/brocade_netiron/mock_data/test_get_network_instances/no_vrfs/expected_result.json Expected get_network_instances() result for NetIron “no_vrfs” case.
device-discovery/custom_napalm/extreme_vsp.py Adds VSP VRF parsing + get_network_instances() implementation.
device-discovery/custom_napalm/extreme_slx.py Adds SLX get_network_instances() derived from the show ip interface brief parsed rows.
device-discovery/custom_napalm/dell_ftos.py Adds OS9 VRF parser (wrapping + range expansion + abbrev expansion) + get_network_instances().
device-discovery/custom_napalm/brocade_netiron.py Adds NetIron VRF parser + canonicalization of member tokens + get_network_instances().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread device-discovery/custom_napalm/extreme_vsp.py Outdated
Comment thread device-discovery/custom_napalm/extreme_slx.py Outdated
…rows; vsp indented rows

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@leoparente

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5fd51aa831

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread device-discovery/custom_napalm/dell_ftos.py
Comment thread device-discovery/custom_napalm/extreme_slx.py Outdated
…y; ftos indentation-gated continuations

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@leoparente

Copy link
Copy Markdown
Contributor Author

@codex review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

Comment thread device-discovery/custom_napalm/extreme_slx.py Outdated
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@leoparente

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 017d47d3ba

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread device-discovery/custom_napalm/dell_ftos.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

Comment thread device-discovery/custom_napalm/extreme_vsp.py
…single-vrf request skips n+1 calls

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@leoparente

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

Comment thread device-discovery/custom_napalm/dell_ftos.py
…inherited members

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated no new comments.

@leoparente leoparente merged commit 0506d23 into develop Jun 11, 2026
10 checks passed
@leoparente leoparente deleted the feat/device-discovery-vrf-drivers-batch4 branch June 11, 2026 17:41
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.

3 participants