From 11ae4742007e4bd9027cc0c23b28165c92268120 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Mass=C3=A9?= Date: Mon, 7 Jan 2019 14:14:11 +0100 Subject: [PATCH] see #33: update the playbook for python 3.x compatibility --- .travis.yml | 10 +++++++--- vars/main.yml | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 22a5838..429c88d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,12 @@ language: python -python: -- '2.7' +matrix: + include: + - python: '2.7' + env: ANSIBLE_VERSION=2.4.6 + - python: '3.7' + env: ANSIBLE_VERSION=2.7.5 install: -- pip install ansible==2.4.0 +- pip install ansible==$ANSIBLE_VERSION - pip install jmespath # Pre-install go-swagger locally since it cannot be fetched from the Travis-CI # infrastructures because of rate limits imposed by GitHub on its API. diff --git a/vars/main.yml b/vars/main.yml index b7a5233..a492d75 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -29,7 +29,7 @@ threescale_cicd_api_version_components: '{{ threescale_cicd_api_version.split(". threescale_cicd_api_version_major: '{{ threescale_cicd_api_version_components|first }}' threescale_cicd_api_security_requirements: '{{ threescale_cicd_openapi_file_content.security|default([]) }}' threescale_cicd_api_security_definitions: '{{ threescale_cicd_openapi_file_content.securityDefinitions|default({}) }}' -threescale_cicd_api_security_scheme_name: '{{ threescale_cicd_api_security_requirements[0].keys()[0]|default(''none'') }}' +threescale_cicd_api_security_scheme_name: '{{ (threescale_cicd_api_security_requirements|first|default(''{ "none": {} }'')).keys()|list|first }}' threescale_cicd_api_security_scheme: '{{ threescale_cicd_api_security_definitions[threescale_cicd_api_security_scheme_name] if threescale_cicd_api_security_scheme_name in threescale_cicd_api_security_definitions else {} }}' threescale_cicd_api_backend_version: '{{ threescale_cicd_backend_version_mapping[threescale_cicd_api_security_scheme.type] }}' threescale_cicd_backend_version_mapping: