pan-os-python
pan-os-python copied to clipboard
Fix for None datatype in _parse_job_results()
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.~~
: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?