IBM / k8s-storage-tests

Playbooks for validating a Kubernetes persistent storage for IBM Cloud Paks
Apache License 2.0
16 stars 12 forks source link

Unable to run test-suite on python3.9 #20

Open ralberrto opened 9 months ago

ralberrto commented 9 months ago
(.venv) alberto@thinkpad $ ansible-playbook main.yml --extra-vars "@./params.yml" | tee output.log
ERROR! Unexpected Exception, this is probably a bug: Failed to detect selinux python bindings at ['/usr/local/lib64/python3.9/site-packages', '/usr/local/lib/python3.9/site-packages', '/usr/lib64/python3.9/site-packages', '/usr/lib/python3.9/site-packages']
the full traceback was:

Traceback (most recent call last):
  File "/home/alberto/k8s-storage-tests/.venv/bin/ansible-playbook", line 92, in <module>
    mycli = getattr(__import__("ansible.cli.%s" % sub, fromlist=[myclass]), myclass)
  File "/home/alberto/k8s-storage-tests/.venv/lib64/python3.9/site-packages/ansible/cli/__init__.py", line 24, in <module>
    from ansible.parsing.dataloader import DataLoader
  File "/home/alberto/k8s-storage-tests/.venv/lib64/python3.9/site-packages/ansible/parsing/dataloader.py", line 17, in <module>
    from ansible.module_utils.basic import is_executable
  File "/home/alberto/k8s-storage-tests/.venv/lib64/python3.9/site-packages/ansible/module_utils/basic.py", line 77, in <module>
    import selinux
  File "/home/alberto/k8s-storage-tests/.venv/lib64/python3.9/site-packages/selinux/__init__.py", line 106, in <module>
    check_system_sitepackages()
  File "/home/alberto/k8s-storage-tests/.venv/lib64/python3.9/site-packages/selinux/__init__.py", line 102, in check_system_sitepackages
    raise Exception(
Exception: Failed to detect selinux python bindings at ['/usr/local/lib64/python3.9/site-packages', '/usr/local/lib/python3.9/site-packages', '/usr/lib64/python3.9/site-packages', '/usr/lib/python3.9/site-packages']
(.venv) alberto@thinkpad $ python -V
Python 3.9.16

PLAY [localhost] ***

TASK [ocp login using creds] *** skipping: [localhost]

TASK [ocp login using token] *** changed: [localhost]

TASK [debug] *** skipping: [localhost]

TASK [debug] *** ok: [localhost] => { "login_token.stdout_lines": [ "WARNING: Using insecure TLS client config. Setting this option is not supported!", "", "Logged into \"https://api.ocp-d.cpst-lab.ibm.com:6443\" as \"kube:admin\" using the token provided.", "", "You have access to 83 projects, the list has been suppressed. You can list all projects with 'oc projects'", "", "Using project \"default\"." ] } . . .

(.venv36) alberto@thinkpad $ python -V Python 3.6.8

- Nor for version `3.10`:

(.venv310) alberto@thinkpad $ ansible-playbook main.yml --extra-vars "@./params.yml" | tee output.log [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

PLAY [localhost] ***

TASK [ocp login using creds] *** skipping: [localhost]

TASK [ocp login using token] *** changed: [localhost]

TASK [debug] *** skipping: [localhost]

TASK [debug] *** ok: [localhost] => { "login_token.stdout_lines": [ "WARNING: Using insecure TLS client config. Setting this option is not supported!", "", "Logged into \"https://api.ocp-d.cpst-lab.ibm.com:6443\" as \"kube:admin\" using the token provided.", "", "You have access to 84 projects, the list has been suppressed. You can list all projects with 'oc projects'", "", "Using project \"default\"." ] }

TASK [Storage Readiness] *** [WARNING]: Collection kubernetes.core does not support Ansible version 2.10.17

TASK [storage-readiness : Create namespace storage-tests if not present] ***

. . .

(.venv310) alberto@thinkpad $ python -V Python 3.10.9

ralberrto commented 9 months ago

This might be a problem with selinux on my system somehow:

(.venv) alberto@thinkpad $ python
Python 3.9.16 (main, May 31 2023, 12:21:58) 
[GCC 8.5.0 20210514 (Red Hat 8.5.0-18)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import selinux
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/alberto/k8s-storage-tests/.venv/lib64/python3.9/site-packages/selinux/__init__.py", line 106, in <module>
    check_system_sitepackages()
  File "/home/alberto/k8s-storage-tests/.venv/lib64/python3.9/site-packages/selinux/__init__.py", line 102, in check_system_sitepackages
    raise Exception(
Exception: Failed to detect selinux python bindings at ['/usr/local/lib64/python3.9/site-packages', '/usr/local/lib/python3.9/site-packages', '/usr/lib64/python3.9/site-packages', '/usr/lib/python3.9/site-packages']

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8" REDHAT_BUGZILLA_PRODUCT_VERSION=8.8 REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" REDHAT_SUPPORT_PRODUCT_VERSION="8.8"