Skip to content

panos_software module is looking for base model ending with x.x.0 #662

@kristoevr

Description

@kristoevr

Describe the bug

Upgrading a PA-415-5G from PAN-OS 11.2.11 to 12.1.2 via panos_software fails with KeyError: '12.1.0' in needs_download (panos_software.py line 148). The 12.1 branch has no 12.1.0 base release after checking it from the GUI.

Expected behavior

panos_software should handle upgrade targets, for example jump from 11.2.11 to 12.1.2 should be within the supported skip range.

Current behavior

Traceback (most recent call last):
File "/runner/.ansible/tmp/ansible-tmp-1776071609.8420632-460-79313746290468/AnsiballZ_panos_software.py", line 107, in
_ansiballz_main()
File "/runner/.ansible/tmp/ansible-tmp-1776071609.8420632-460-79313746290468/AnsiballZ_panos_software.py", line 99, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/runner/.ansible/tmp/ansible-tmp-1776071609.8420632-460-79313746290468/AnsiballZ_panos_software.py", line 47, in invoke_module
runpy.run_module(mod_name='ansible_collections.paloaltonetworks.panos.plugins.modules.panos_software', init_globals=dict(_module_fqn='ansible_collections.paloaltonetworks.panos.plugins.modules.panos_software', _modlib_path=modlib_path),
File "", line 226, in run_module
File "", line 98, in _run_module_code
File "", line 88, in _run_code
File "/tmp/ansible_paloaltonetworks.panos.panos_software_payload_yz7nek3t/ansible_paloaltonetworks.panos.panos_software_payload.zip/ansible_collections/paloaltonetworks/panos/plugins/modules/panos_software.py", line 340, in
File "/tmp/ansible_paloaltonetworks.panos.panos_software_payload_yz7nek3t/ansible_paloaltonetworks.panos.panos_software_payload.zip/ansible_collections/paloaltonetworks/panos/plugins/modules/panos_software.py", line 306, in main
File "/tmp/ansible_paloaltonetworks.panos.panos_software_payload_yz7nek3t/ansible_paloaltonetworks.panos.panos_software_payload.zip/ansible_collections/paloaltonetworks/panos/plugins/modules/panos_software.py", line 148, in needs_download
KeyError: '12.1.0'

Steps to reproduce

1.Firewall running PAN-OS 11.2.11 with internet access to updates.paloaltonetworks.com
2.request system software check confirms 12.1.2 is available (11.2.0 and 11.1.0 also listed as bases; no 12.1.0 exists)
3. Run panos_software with version: 12.1.2, download: true, install: true
4. Module fails with KeyError before initiating download

Your Environment

dependencies:
ansible_core:
package_pip: ansible-core==2.16.14
ansible_runner:
package_pip: ansible-runner
system:
- openssh-clients
- sshpass
galaxy:
collections:
- name: paloaltonetworks.panos
version: ">=3.3.0,<4.0.0"
python:
- pan-os-python
- pan-python
- xmltodict

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions