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

update content package is not functional with version string

Open kevinhuy opened this issue 3 years ago • 3 comments

Describe the bug

when trying to install a specific version in content update it failed.

fw = firewall.Firewall(hostname="", username="")    
updater.ContentUpdater(fw).check()
updater.ContentUpdater(fw).download()
updater.ContentUpdater(fw).install(version="8503-7125", sync=True)

Expected behavior

execute without error

Current behavior

Traceback (most recent call last): File "test_update_content.py", line 41, in main() File "test_update_content.py", line 37, in main install_content = updater.ContentUpdater(fw).install(version="8503-7125", sync=True) File "/home/kevin/.pyenv/versions/panos/lib/python3.8/site-packages/panos/updater.py", line 544, in install response = self._op(op) File "/home/kevin/.pyenv/versions/panos/lib/python3.8/site-packages/panos/updater.py", line 38, in _op return self.pandevice.xapi.op(cmd, cmd_xml=True) File "/home/kevin/.pyenv/versions/panos/lib/python3.8/site-packages/panos/base.py", line 3682, in method raise the_exception panos.errors.PanDeviceXapiError: request -> content -> upgrade -> install -> version '8503-7125' is not an allowed keyword request -> content -> upgrade -> install -> version is invalid

Possible solution

with keyword latest it work without issue. updater.ContentUpdater(fw).install(version="latest", sync=True)

kevinhuy avatar Dec 17 '21 16:12 kevinhuy

:tada: Thanks for opening your first issue here! Welcome to the community!

Is "9503-7125" downloaded before you try to invoke .install(version="9503-7125")?

shinmog avatar Jan 17 '22 07:01 shinmog

Hi

Yes was already downloaded before the try.

Thks

kevinhuy avatar Jan 17 '22 07:01 kevinhuy