Skip to content

fix(neutron): refactor palo_alto to move pure functions out of class - #2458

Open
nidzrai wants to merge 18 commits into
mainfrom
refactor_palo
Open

nidzrai wants to merge 18 commits into
mainfrom
refactor_palo

Conversation

@nidzrai

@nidzrai nidzrai commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

What does this change do?

  1. These methods don't use self except to get their inputs , so moving out these pure functions to module level
  2. Added named exception
  3. One router-lookup helper
  4. redundant _has_subport , removed dead _remove_gateway_subport
  5. change _ensure_parent_vif_attached a single exit path (Fetch the port, check Ironic annotated it, return it" lived in both the helper and the main function) , _confirm_parent_vif_attach_after_error returned dict but ideally it should be bool .
  6. Refactor _InterfaceAttachment checks, moved th check out of handler
  7. Move the gateway/interface wiring methods (anchor network, parent port, VIF attach, trunk, subports, teardown, snapshot/undo) from the PaloAlto L3 service provider into a PaloAltoWiring class in palo_alto_wiring.py. The class has no callback subscriptions, so the planned wiring reconciler can reuse it outside the L3 plugin.

This is a move only: method names and bodies are unchanged, except that the Ironic client and trunk plugin lookups are now methods instead of properties. PaloAlto keeps the event subscriptions, flavor check, node adopt/release and rollback bookkeeping, and delegates wiring to self._wiring. It still creates the IronicClient and passesthe wiring a getter, so both share one lazily created client.

Upgrade impact

  • This change requires operator action to upgrade. If checked, add the
    upgrade-impact label and a release note: run scriv create from the
    repository root and describe the required action in the generated
    changelog.d/ file. See RELEASING.md.

Operator action means anything a deployment has to do beyond a normal resync:
deploy repo or values changes, new or removed secrets, enabling or disabling a
component, or a manual one-time step.

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Python test results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
1 files    0 ❌
1 errors

For more details on these parsing errors, see this check.

Results for commit f96fa5c.

♻️ This comment has been updated with latest results.

@nidzrai
nidzrai requested review from cardoe and mfencik October 11, 2026 15:15

This branch has not been deployed

No deployments
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