test: older_openshift_fail.yml fails with py3.7+ (#291)

The `older_openshift_fail.yml` test playbook fails with Python 3.7 because the old `kubernetes.client.apis.admissionregistration_api` module uses the new `async` keyword as a function parameter name. From: https://docs.python.org/3/whatsnew/3.7.html

Backwards incompatible syntax changes:

    `async` and `await` are now reserved keywords.

In this case, we get a `SyntaxError` exception instead of the expected `Failed to import the required Python library (openshift >= 0.7.2)`.
This commit is contained in:
Gonéri Le Bouder
2020-11-10 14:27:23 -05:00
committed by GitHub
parent c76aa6e45a
commit eff6759660

View File

@@ -73,7 +73,12 @@
no_log: yes no_log: yes
# Test graceful failure for older versions of openshift # Test graceful failure for older versions of openshift
- name: Get the Python version
setup:
filter: ansible_python_version
- when: ansible_python_version is version('3.7', '<')
block:
- pip: - pip:
name: name:
- openshift==0.6.0 - openshift==0.6.0
@@ -88,6 +93,7 @@
ansible_python_interpreter: "{{ virtualenv_interpreter }}" ansible_python_interpreter: "{{ virtualenv_interpreter }}"
playbook_namespace: ansible-test-k8s-older-openshift playbook_namespace: ansible-test-k8s-older-openshift
- file: - file:
path: "{{ virtualenv }}" path: "{{ virtualenv }}"
state: absent state: absent