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

panos-upgrade-assurance issue in check_firewall.py #599

Open
pdcar opened this issue Feb 8, 2024 · 0 comments
Open

panos-upgrade-assurance issue in check_firewall.py #599

pdcar opened this issue Feb 8, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@pdcar
Copy link

pdcar commented Feb 8, 2024

Describe the bug

Running the ansible module panos_active_in_ha in a playbook we get errors generated by the script:
/usr/local/lib/python3.9/site-packages/panos_upgrade_assurance/check_firewall.py, line 109 (locale.setlocale)

It is referencing for a locale code from:
/usr/lib64/python3.9/locale.py", line 610

But errors with this:
setlocale(category, locale)\nlocale.Error: unsupported locale setting\n"

We have looked in the /usr/lib64/python3.9/locale.py in the execution environment, the section that is reporting back to check_firewall.py is:
if locale and not isinstance(locale, _builtin_str):
# convert to string
locale = normalize(_build_localename(locale))
return _setlocale(category, locale)

And we can see the default locale from check_firewall.py listed as a locale in locale.py

The locale of execution environment is: LANG=C.utf8 (which is in locale.py, but all lower case (if that is an issue))

Expected behavior

To use the default locale as expected

Current behavior

Playbook fails with this error

"/tmp/ansible_paloaltonetworks.panos.panos_active_in_ha_payload_87h9q4vv/ansible_paloaltonetworks.panos.panos_active_in_ha_payload.zip/ansible_collections/paloaltonetworks/panos/plugins/modules/panos_active_in_ha.py", line 125, in main\n File "/usr/local/lib/python3.9/site-packages/panos_upgrade_assurance/check_firewall.py", line 109, in init\n locale.setlocale(\n File "/usr/lib64/python3.9/locale.py", line 610, in setlocale\n return _setlocale(category, locale)\nlocale.Error: unsupported locale setting\n",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",

Possible solution

Unsure

Steps to reproduce

Our requirements.txt for the ansible-builder application are the below, we are installing all

scp
pyats
ansible-pylibssh
ntc-templates
netmiko
paramiko
pan-os-python
pan-python
pandevice
panos-upgrade-assurance

We are installing these collections:
collections:

  • name: ansible.netcommon
  • name: ansible.utils
  • name: ansible.windows
  • name: vmware.vmware_rest
  • name: paloaltonetworks.panos
  • name: dellemc.os10
  • name: dellemc.os9
  • name: dellemc.os6

The execution environment is based from the latest EE_BASE_IMAGE each time
EE_BASE_IMAGE: quay.io/ansible/awx-ee:latest

Context

We are trying to use the panos_active_in_ha.py module to be able to force sync config from the active firewall in a HA Pair

Your Environment

Enough info should be detailed above. We are using AWX on a single node kubernetes environment

@pdcar pdcar added the bug Something isn't working label Feb 8, 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