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

Policy Match Rule Fails to Retry #541

Open
jvanderaa opened this issue Feb 13, 2024 · 0 comments
Open

Policy Match Rule Fails to Retry #541

jvanderaa opened this issue Feb 13, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jvanderaa
Copy link

Describe the bug

panos_match_rule fails to handle retries due to a Python exception being thrown instead of having an Ansible error thrown. This was observed when having a Session timeout happen. Received the following two traceback errors that exited the Ansible execution:

pan.xapi.PanXapiError: Session timed out

Also in the same it received another exception:

panos.errors.PanSessionTimedOut: Session timed out

Expected behavior

Expect that the module would accept retries in in a timeout scenario.

Current behavior

Python exceptions cause Ansible to exit rather than allow for the Ansible module to handle the retry.

Possible solution

Wrap the module data inside of a try/except block, raising the error data to a fail_json() method

Steps to reproduce

  1. Create a policy-rule-match test
  2. Have a timeout occur

Screenshots

Context

Working to complete some rule match verification

Your Environment

  • Collection:
  • Python:
  • Ansible:
  • PAN-OS Python Library & version (e.g. pandevice 0.14.0, pan-os-python 1.0.2):
@jvanderaa jvanderaa added the bug Something isn't working label Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant