pan-os-python icon indicating copy to clipboard operation
pan-os-python copied to clipboard

Fix for None datatype in _parse_job_results()

Open undodelete opened this issue 3 years ago • 2 comments

Description

Adding an exception handler to catch datatype errors with jobs where details is None.

Motivation and Context

Resolve bug described in #470

How Has This Been Tested?

The command that encountered the issue were rerun and the response was successful.

download_cmd = "<request><plugins><download><file>vm_series-2.1.2</file></download></plugins></request>"
download_response = parent.op(download_cmd, cmd_xml=False)
download_result = parent.syncjob(download_response)

Successful download response

{
   "success":true,
   "result":"OK",
   "jobid":"18",
   "user":"None",
   "warnings":"None",
   "starttime":"2022/07/26 08:58:18",
   "endtime":"08:58:19",
   "messages":[
      
   ],
   "devices":{
      
   },
   "xml":"<Element""response"at 0x7f68569ca180>
}

Tested against panos 9.1 using the pan-os-python poetry venv. This is very small and self contained change and won't affect other parts of the code base.

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

~~- [ ] I have updated the documentation accordingly.~~

  • [x] I have read the CONTRIBUTING document. ~~- [ ] I have added tests to cover my changes if appropriate.~~ ~~- [ ] All new and existing tests passed.~~

undodelete avatar Jul 26 '22 19:07 undodelete

:tada: Thanks for opening this pull request! We really appreciate contributors like you! :raised_hands:

I had a similar issue. Can @shinmog or @btorresgil review?

ewlumpkin avatar Sep 10 '22 02:09 ewlumpkin