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,8 +73,13 @@
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
- pip: - when: ansible_python_version is version('3.7', '<')
block:
- pip:
name: name:
- openshift==0.6.0 - openshift==0.6.0
- kubernetes==6.0.0 - kubernetes==6.0.0
@@ -83,11 +88,12 @@
virtualenv_command: "{{ virtualenv_command }}" virtualenv_command: "{{ virtualenv_command }}"
virtualenv_site_packages: no virtualenv_site_packages: no
- include_tasks: older_openshift_fail.yml - include_tasks: older_openshift_fail.yml
vars: vars:
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