PaloAltoNetworks/pan-os-ansible

Policy Match Rule Fails to Retry

jvanderaa opened this issue · 0 comments

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):