Skip to content

fix: return cleanly when a commit response has no job id - #631

Open
anandhx wants to merge 1 commit into
PaloAltoNetworks:developfrom
anandhx:fix/commit-without-job-id
Open

anandhx wants to merge 1 commit into
PaloAltoNetworks:developfrom
anandhx:fix/commit-without-job-id

Conversation

@anandhx

@anandhx anandhx commented Nov 6, 2026

Copy link
Copy Markdown

Summary

  • Committing when nothing has changed returns a status line and no <job>. PanDevice._commit logged that line and then read jobid, which was never assigned, so Ansible panos_commit_firewall / panos_commit_panorama crashed with UnboundLocalError or AttributeError.
  • No job now returns None, which is what the method already documents for "commit not needed". exception=True still raises PanCommitNotNeeded.
  • Log Collector Group pushes, which succeed without a job id, still return the synthetic success result.

Test plan

  • python -m unittest tests.test_firewall -v
  • Commit a Panorama or firewall that has no pending changes and confirm the call returns without an exception
  • Commit when a change is pending and confirm the job id is still returned

Fixes #569

Made with Cursor

A nothing-to-commit response includes a status line and no job. The handler logged that line and then used jobid, which had never been set.

Co-authored-by: Cursor <[email protected]>

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.

Issue with #493 when commit is not required, response None

1 participant