Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'warnings' during Panorama commit/push. #336

Closed
btorresgil opened this issue May 11, 2021 · 1 comment · Fixed by #337
Closed

KeyError: 'warnings' during Panorama commit/push. #336

btorresgil opened this issue May 11, 2021 · 1 comment · Fixed by #337
Assignees

Comments

@btorresgil
Copy link
Member

Describe the bug

Commit_all (commit/push) from Panorama to devices sometimes results in a KeyError.

Expected behavior

There should not be an error.

Current behavior

Commit succeeds, but pan-os-python raises a KeyError:

Traceback (most recent call last):
  File "test.py", line 14, in <module>
    pano.commit(cmd=cmd, sync=True, sync_all=True)
  File "/Users/btorresgil/Documents/Development/pandevice/panos/base.py", line 4535, in commit
    return self._commit(
  File "/Users/btorresgil/Documents/Development/pandevice/panos/base.py", line 4637, in _commit
    result = self.syncjob(commit_response, sync_all=sync_all)
  File "/Users/btorresgil/Documents/Development/pandevice/panos/base.py", line 4744, in syncjob
    return self._parse_job_results(job_xml, get_devices=True)
  File "/Users/btorresgil/Documents/Development/pandevice/panos/base.py", line 4908, in _parse_job_results
    "warnings": job["warnings"],
KeyError: 'warnings'

Steps to reproduce

from panos.panorama import Panorama, PanoramaCommitAll

pano = Panorama("10.1.1.1", "admin", "password")

cmd = PanoramaCommitAll(
    style="template stack",
    name="stack_1",
    description="",
    include_template=False,
    force_template_values=False,
    devices=["1234567890"],
)

pano.commit(cmd=cmd, sync=True, sync_all=True)

Context

Affects Ansible module panos_commit_push. See PaloAltoNetworks/pan-os-ansible#178

Your Environment

  • Version used: pan-os-python 1.0.2 - PAN-OS 8.1, 9.0, 9.1, 10.0
  • Environment name and version (e.g. Chrome 59, node.js 5.4, python 3.7.3): python 3.x
  • Operating System and version (desktop or mobile): Any
@btorresgil btorresgil added the bug label May 11, 2021
@btorresgil btorresgil self-assigned this May 11, 2021
btorresgil added a commit that referenced this issue May 11, 2021
btorresgil added a commit that referenced this issue May 12, 2021
github-actions bot pushed a commit that referenced this issue May 12, 2021
### [1.1.1](v1.1.0...v1.1.1) (2021-05-12)

### Bug Fixes

* KeyError during Panorama commit/push ([1a53e9b](1a53e9b)), closes [#336](#336)
* PanoramaCommitAll - False args ignored ([c2652eb](c2652eb)), closes [#332](#332) [PaloAltoNetworks/pan-os-ansible#204](PaloAltoNetworks/pan-os-ansible#204)
@github-actions
Copy link

🎉 This issue has been resolved in version 1.1.1 🎉

The release is available on PyPI and GitHub release

Posted by semantic-release bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant