Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pan_os_python requirements issue #568

Open
carlosfparada opened this issue Jun 13, 2024 · 0 comments
Open

pan_os_python requirements issue #568

carlosfparada opened this issue Jun 13, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@carlosfparada
Copy link

Describe the bug

Recently, I noticed an error running the paloaltonetworks.panos.panos_http_profile module. It says
"pan-os-python version (1.8.0) < minimum version (1.10.0)", "sdk_package_path": "/usr/local/lib/python3.9/site-packages/panos". So it seems pan-os-python v1.10 or higher is expected.

However, trying to create an execution environment with the collection paloaltonetworks.panos (a single collection on requirements.yml) and adding library pan-os-python >= 1.10.0 (on requirements.txt) I get the following error:
"ERROR: Could not find a version that satisfies the requirement pan_os_python==1.8.0,>=1.10.0 (from -r /tmp/src/requirements.txt (line 28)) (from versions: 1.0.0b1, 1.0.0b2, 1.0.0, 1.0.1, 1.0.2, 1.1.0, 1.1.1, 1.2.0, 1.3.0, 1.4.0, 1.5.0, 1.5.1, 1.6.0, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.8.0, 1.8.1, 1.9.0, 1.10.0, 1.11.0, 1.12.0, 1.12.1)
ERROR: No matching distribution found for pan_os_python==1.8.0,>=1.10.0 (from -r /tmp/src/requirements.txt (line 28))
Error: building at STEP "RUN /output/scripts/assemble": while running runtime: exit status 1".

So it seems pan_os_python==1.8.0, and pan_os_python>=1.10.0 conditions cannot be met, which of course makes sense as the python library cannot be equal to 1.8.0 and greater or equal than 1.10.0. Trying to understand from where this ==1.8.0 dependency comes from (the other comes from my EE requirements.txt), I realized that it comes from the requirements.txt collection itself:
"pan-os-python==1.8.0 ; python_version >= "3.8" and python_version < "4.0"
--hash=sha256:843972122ef4c5bfd17354070e3ada1285e243325f5e7cf7fd969150048becd4
--hash=sha256:da9153fe4a961a43d36016851ab06df45a37ea8612ed36b3b5b528f8394f34f5
"
So it seems the collection says it needs pan-os-python to be ==1.8.0 while with some modules, at least panos_http_profile, it requires >=1.10.0 to run.

Expected behavior

The requirements.txt on the collection should state pan-os-python>=1.10.0 as this is what is need to run some modules.

Current behavior

There is a collision about what the collection python dependencies state, and what is actually needed to run.

Possible solution

In the collection requirements.txt change the pan-os-python to something like :
"pan-os-python>=1.10.0 ; python_version >= "3.8" and python_version < "4.0"
--hash=sha256:843972122ef4c5bfd17354070e3ada1285e243325f5e7cf7fd969150048becd4
--hash=sha256:da9153fe4a961a43d36016851ab06df45a37ea8612ed36b3b5b528f8394f34f5

Steps to reproduce

Can be reproduced using this piece of code.

- name: Create a HTTP Server Profile for Config Logs
  paloaltonetworks.panos.panos_http_profile:
    provider: "{{ panos_provider }}"
    name: "{{ profile_name }}"
    config_name: "{{ config_profile_name }}"
    config_uri_format: '/test'
    config_payload: "{{ config_payload }}"

Screenshots

Context

Issue occurs when trying to create HTTP log configurations with paloaltonetworks.panos.panos_http_profile module, but eventually the same can happen with other modules.

Your Environment

  • Collection: 2.17.7
  • Python: 3.9.14
  • Ansible: 2.14.2
  • PAN-OS Python Library & version (pan-os-python 1.8.0, 1.10.0):
@carlosfparada carlosfparada added the bug Something isn't working label Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant