pan-os-python
pan-os-python copied to clipboard
Syncreboot on firewall fails via Panorama
Describe the bug
Did a upgrade_to_version() on a Firewall via Panorama and got an exception when it waited for reboot.
Expected behavior
Syncreboot should poll device information untill reboot successfully or timeout reached.
Current behavior
After some time an exception is raised from base.py
File "/.local/lib/python3.8/site-packages/panos/base.py", line 4748, in syncreboot raise e File "/.local/lib/python3.8/site-packages/panos/base.py", line 4739, in syncreboot version = self.refresh_version() File "/.local/lib/python3.8/site-packages/panos/base.py", line 3986, in refresh_version system_info = self.refresh_system_info() File "/.local/lib/python3.8/site-packages/panos/base.py", line 3938, in refresh_system_info system_info = self.show_system_info() File "/.local/lib/python3.8/site-packages/panos/base.py", line 3895, in show_system_info root = self.xapi.op(cmd="show system info", cmd_xml=True) File "/.local/lib/python3.8/site-packages/panos/base.py", line 3647, in method raise the_exception panos.errors.PanDeviceXapiError: serialnr not connected
Possible solution
Not a great solution but what I did for a quick fix was add check error if not str(e).endswith("not connected") as this is a connection error thrown by panorama(?)
Steps to reproduce
i.e:
fw = Firewall(serial=<serialnr>)
panorama = Panorama(ip, usn, pw)
panorama.add(fw)
fw.restart()
fw.syncreboot()
`
Can also start a upgrade_to_version and wait for reboot.
Context
Automatically setup and update many hardware model PA-220
Your Environment
Hardware model PA-220 Python 3.8 pan-os-python==1.0.0b2
:tada: Thanks for opening your first issue here! Welcome to the community!