From 53affc3220362435906909a0caa2233e1878802f Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sun, 1 Mar 2020 06:29:59 -0600 Subject: [PATCH] Test with and assert support for python3 Collections are new. openstacksdk as of now doesn't support python2. We shouldn't pretend to support python2 either. If you're using ansible new enough to use collections, you can use python3. This release of openstacksdk only supports 3.6 and onwards, so set that as our min. Change-Id: I34d544ce48f25bffde8e6e0cf82cdf9a85e681c3 --- plugins/doc_fragments/openstack.py | 2 +- plugins/modules/os_auth.py | 2 +- plugins/modules/os_flavor_info.py | 2 +- plugins/modules/os_group.py | 2 +- plugins/modules/os_group_info.py | 2 +- plugins/modules/os_image_info.py | 2 +- plugins/modules/os_keystone_domain.py | 2 +- plugins/modules/os_keystone_domain_info.py | 2 +- plugins/modules/os_keystone_role.py | 2 +- plugins/modules/os_keystone_service.py | 2 +- plugins/modules/os_networks_info.py | 2 +- plugins/modules/os_nova_host_aggregate.py | 2 +- plugins/modules/os_port.py | 2 +- plugins/modules/os_port_info.py | 2 +- plugins/modules/os_project.py | 2 +- plugins/modules/os_project_info.py | 2 +- plugins/modules/os_quota.py | 2 +- plugins/modules/os_recordset.py | 2 +- plugins/modules/os_routers_info.py | 2 +- plugins/modules/os_server.py | 2 +- plugins/modules/os_server_action.py | 2 +- plugins/modules/os_server_group.py | 2 +- plugins/modules/os_server_info.py | 2 +- plugins/modules/os_server_metadata.py | 2 +- plugins/modules/os_server_volume.py | 2 +- plugins/modules/os_stack.py | 2 +- plugins/modules/os_subnet.py | 2 +- plugins/modules/os_subnets_info.py | 2 +- plugins/modules/os_user.py | 2 +- plugins/modules/os_user_group.py | 2 +- plugins/modules/os_user_info.py | 2 +- plugins/modules/os_user_role.py | 2 +- plugins/modules/os_volume.py | 2 +- plugins/modules/os_volume_snapshot.py | 2 +- plugins/modules/os_zone.py | 2 +- tox.ini | 3 ++- 36 files changed, 37 insertions(+), 36 deletions(-) diff --git a/plugins/doc_fragments/openstack.py b/plugins/doc_fragments/openstack.py index a2c3db7d..afc62ea2 100644 --- a/plugins/doc_fragments/openstack.py +++ b/plugins/doc_fragments/openstack.py @@ -86,7 +86,7 @@ options: default: public aliases: [ endpoint_type ] requirements: - - python >= 2.7 + - python >= 3.6 - openstacksdk >= 0.12.0 notes: - The standard OpenStack environment variables, such as C(OS_USERNAME) diff --git a/plugins/modules/os_auth.py b/plugins/modules/os_auth.py index c51ed396..eea40c8c 100644 --- a/plugins/modules/os_auth.py +++ b/plugins/modules/os_auth.py @@ -17,7 +17,7 @@ author: "Monty Taylor (@emonty)" description: - Retrieve an auth token from an OpenStack Cloud requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" options: availability_zone: diff --git a/plugins/modules/os_flavor_info.py b/plugins/modules/os_flavor_info.py index 5d5fb95b..d2f378f8 100644 --- a/plugins/modules/os_flavor_info.py +++ b/plugins/modules/os_flavor_info.py @@ -26,7 +26,7 @@ description: notes: - The result contains a list of unsorted flavors. requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" options: name: diff --git a/plugins/modules/os_group.py b/plugins/modules/os_group.py index 1ea9426b..17beffe5 100644 --- a/plugins/modules/os_group.py +++ b/plugins/modules/os_group.py @@ -36,7 +36,7 @@ options: description: - Ignored. Present for backwards compatibility requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" extends_documentation_fragment: diff --git a/plugins/modules/os_group_info.py b/plugins/modules/os_group_info.py index 0c3b9d8d..cdc1c446 100644 --- a/plugins/modules/os_group_info.py +++ b/plugins/modules/os_group_info.py @@ -17,7 +17,7 @@ author: "Phillipe Smith (@phsmith)" description: - Retrieve info about a one or more OpenStack groups. requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" options: name: diff --git a/plugins/modules/os_image_info.py b/plugins/modules/os_image_info.py index 4a03c226..e4290970 100644 --- a/plugins/modules/os_image_info.py +++ b/plugins/modules/os_image_info.py @@ -18,7 +18,7 @@ description: - This module was called C(os_image_facts) before Ansible 2.9, returning C(ansible_facts). Note that the M(os_image_info) module no longer returns C(ansible_facts)! requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" options: image: diff --git a/plugins/modules/os_keystone_domain.py b/plugins/modules/os_keystone_domain.py index 271c526b..4a05a989 100644 --- a/plugins/modules/os_keystone_domain.py +++ b/plugins/modules/os_keystone_domain.py @@ -41,7 +41,7 @@ options: description: - Ignored. Present for backwards compatibility requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" extends_documentation_fragment: diff --git a/plugins/modules/os_keystone_domain_info.py b/plugins/modules/os_keystone_domain_info.py index b35e430a..a5f637df 100644 --- a/plugins/modules/os_keystone_domain_info.py +++ b/plugins/modules/os_keystone_domain_info.py @@ -18,7 +18,7 @@ description: - This module was called C(os_keystone_domain_facts) before Ansible 2.9, returning C(ansible_facts). Note that the M(os_keystone_domain_info) module no longer returns C(ansible_facts)! requirements: - - "python >= 2.7" + - "python >= 3.6"" - "sdk" options: name: diff --git a/plugins/modules/os_keystone_role.py b/plugins/modules/os_keystone_role.py index 5dbdae9c..29c212e7 100644 --- a/plugins/modules/os_keystone_role.py +++ b/plugins/modules/os_keystone_role.py @@ -32,7 +32,7 @@ options: - Ignored. Present for backwards compatibility required: false requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" extends_documentation_fragment: diff --git a/plugins/modules/os_keystone_service.py b/plugins/modules/os_keystone_service.py index 843c5c26..27f17c2e 100644 --- a/plugins/modules/os_keystone_service.py +++ b/plugins/modules/os_keystone_service.py @@ -43,7 +43,7 @@ options: description: - Ignored. Present for backwards compatibility requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" extends_documentation_fragment: diff --git a/plugins/modules/os_networks_info.py b/plugins/modules/os_networks_info.py index 59e3f3e7..02cef984 100644 --- a/plugins/modules/os_networks_info.py +++ b/plugins/modules/os_networks_info.py @@ -19,7 +19,7 @@ description: - This module was called C(os_networks_facts) before Ansible 2.9, returning C(ansible_facts). Note that the M(os_networks_info) module no longer returns C(ansible_facts)! requirements: - - "python >= 2.7" + - "python >= 3.6"" - "sdk" options: name: diff --git a/plugins/modules/os_nova_host_aggregate.py b/plugins/modules/os_nova_host_aggregate.py index 78427501..dd0ed806 100644 --- a/plugins/modules/os_nova_host_aggregate.py +++ b/plugins/modules/os_nova_host_aggregate.py @@ -32,7 +32,7 @@ options: choices: [present, absent] default: present requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" extends_documentation_fragment: diff --git a/plugins/modules/os_port.py b/plugins/modules/os_port.py index 764ad267..e8474f35 100644 --- a/plugins/modules/os_port.py +++ b/plugins/modules/os_port.py @@ -18,7 +18,7 @@ description: - Add, Update or Remove ports from an OpenStack cloud. A I(state) of 'present' will ensure the port is created or updated if required. requirements: - - "ordereddict unless python >= 2.7" + - "ordereddict unless python >= 3.6"" - "openstacksdk" options: network: diff --git a/plugins/modules/os_port_info.py b/plugins/modules/os_port_info.py index ee3ac666..7419257a 100644 --- a/plugins/modules/os_port_info.py +++ b/plugins/modules/os_port_info.py @@ -18,7 +18,7 @@ description: - This module was called C(os_port_facts) before Ansible 2.9, returning C(ansible_facts). Note that the M(os_port_info) module no longer returns C(ansible_facts)! requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" options: port: diff --git a/plugins/modules/os_project.py b/plugins/modules/os_project.py index 3144fdfc..fdbdcc7a 100644 --- a/plugins/modules/os_project.py +++ b/plugins/modules/os_project.py @@ -45,7 +45,7 @@ options: description: - Ignored. Present for backwards compatibility requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" extends_documentation_fragment: diff --git a/plugins/modules/os_project_info.py b/plugins/modules/os_project_info.py index 92ae3462..e548c6e3 100644 --- a/plugins/modules/os_project_info.py +++ b/plugins/modules/os_project_info.py @@ -18,7 +18,7 @@ description: - This module was called C(os_project_facts) before Ansible 2.9, returning C(ansible_facts). Note that the M(os_project_info) module no longer returns C(ansible_facts)! requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" options: name: diff --git a/plugins/modules/os_quota.py b/plugins/modules/os_quota.py index bcfc3201..dc91cbfc 100644 --- a/plugins/modules/os_quota.py +++ b/plugins/modules/os_quota.py @@ -98,7 +98,7 @@ options: requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk >= 0.13.0" - "keystoneauth1 >= 3.4.0" diff --git a/plugins/modules/os_recordset.py b/plugins/modules/os_recordset.py index a396e7e0..822fa7de 100644 --- a/plugins/modules/os_recordset.py +++ b/plugins/modules/os_recordset.py @@ -49,7 +49,7 @@ options: description: - Ignored. Present for backwards compatibility requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" extends_documentation_fragment: diff --git a/plugins/modules/os_routers_info.py b/plugins/modules/os_routers_info.py index b762ca7d..06f104ab 100644 --- a/plugins/modules/os_routers_info.py +++ b/plugins/modules/os_routers_info.py @@ -18,7 +18,7 @@ author: "Bram Verschueren (@bverschueren)" description: - Retrieve information about one or more routers from OpenStack. requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" options: name: diff --git a/plugins/modules/os_server.py b/plugins/modules/os_server.py index 7ec3c7ce..e46c665a 100644 --- a/plugins/modules/os_server.py +++ b/plugins/modules/os_server.py @@ -169,7 +169,7 @@ options: description: - Availability zone in which to create the server. requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" extends_documentation_fragment: diff --git a/plugins/modules/os_server_action.py b/plugins/modules/os_server_action.py index 336ffab8..12caf58c 100644 --- a/plugins/modules/os_server_action.py +++ b/plugins/modules/os_server_action.py @@ -48,7 +48,7 @@ options: description: - Ignored. Present for backwards compatibility requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" extends_documentation_fragment: diff --git a/plugins/modules/os_server_group.py b/plugins/modules/os_server_group.py index 43be97b2..453a793a 100644 --- a/plugins/modules/os_server_group.py +++ b/plugins/modules/os_server_group.py @@ -40,7 +40,7 @@ options: - Ignored. Present for backwards compatibility required: false requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" extends_documentation_fragment: diff --git a/plugins/modules/os_server_info.py b/plugins/modules/os_server_info.py index ba8bc03d..fbab4ebe 100644 --- a/plugins/modules/os_server_info.py +++ b/plugins/modules/os_server_info.py @@ -21,7 +21,7 @@ description: notes: - The result contains a list of servers. requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" options: server: diff --git a/plugins/modules/os_server_metadata.py b/plugins/modules/os_server_metadata.py index 907d9c73..5ea78b02 100644 --- a/plugins/modules/os_server_metadata.py +++ b/plugins/modules/os_server_metadata.py @@ -38,7 +38,7 @@ options: - Availability zone in which to create the snapshot. required: false requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstack" extends_documentation_fragment: diff --git a/plugins/modules/os_server_volume.py b/plugins/modules/os_server_volume.py index d23f1081..98c1b94d 100644 --- a/plugins/modules/os_server_volume.py +++ b/plugins/modules/os_server_volume.py @@ -39,7 +39,7 @@ options: description: - Ignored. Present for backwards compatibility requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" extends_documentation_fragment: diff --git a/plugins/modules/os_stack.py b/plugins/modules/os_stack.py index 406ff278..07194405 100644 --- a/plugins/modules/os_stack.py +++ b/plugins/modules/os_stack.py @@ -55,7 +55,7 @@ options: description: - Ignored. Present for backwards compatibility requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" extends_documentation_fragment: diff --git a/plugins/modules/os_subnet.py b/plugins/modules/os_subnet.py index 95c61752..4bb2ef31 100644 --- a/plugins/modules/os_subnet.py +++ b/plugins/modules/os_subnet.py @@ -94,7 +94,7 @@ options: required: false default: {} requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" extends_documentation_fragment: diff --git a/plugins/modules/os_subnets_info.py b/plugins/modules/os_subnets_info.py index 40b93c89..9c749b78 100644 --- a/plugins/modules/os_subnets_info.py +++ b/plugins/modules/os_subnets_info.py @@ -19,7 +19,7 @@ description: - This module was called C(os_subnets_facts) before Ansible 2.9, returning C(ansible_facts). Note that the M(os_subnets_info) module no longer returns C(ansible_facts)! requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" options: name: diff --git a/plugins/modules/os_user.py b/plugins/modules/os_user.py index c4e4f0ac..c36b88a9 100644 --- a/plugins/modules/os_user.py +++ b/plugins/modules/os_user.py @@ -59,7 +59,7 @@ options: description: - Ignored. Present for backwards compatibility requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" extends_documentation_fragment: diff --git a/plugins/modules/os_user_group.py b/plugins/modules/os_user_group.py index 4f38fb7c..5eeae6eb 100644 --- a/plugins/modules/os_user_group.py +++ b/plugins/modules/os_user_group.py @@ -34,7 +34,7 @@ options: - Ignored. Present for backwards compatibility required: false requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" extends_documentation_fragment: diff --git a/plugins/modules/os_user_info.py b/plugins/modules/os_user_info.py index 6ecae665..10cfee92 100644 --- a/plugins/modules/os_user_info.py +++ b/plugins/modules/os_user_info.py @@ -18,7 +18,7 @@ description: - This module was called C(os_user_facts) before Ansible 2.9, returning C(ansible_facts). Note that the M(os_user_info) module no longer returns C(ansible_facts)! requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" options: name: diff --git a/plugins/modules/os_user_role.py b/plugins/modules/os_user_role.py index d7c6c9b4..ea0e8b09 100644 --- a/plugins/modules/os_user_role.py +++ b/plugins/modules/os_user_role.py @@ -47,7 +47,7 @@ options: description: - Ignored. Present for backwards compatibility requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" extends_documentation_fragment: diff --git a/plugins/modules/os_volume.py b/plugins/modules/os_volume.py index f40cb738..7bd2cbc7 100644 --- a/plugins/modules/os_volume.py +++ b/plugins/modules/os_volume.py @@ -60,7 +60,7 @@ options: description: - Metadata for the volume requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" extends_documentation_fragment: diff --git a/plugins/modules/os_volume_snapshot.py b/plugins/modules/os_volume_snapshot.py index 38a58552..36836af8 100644 --- a/plugins/modules/os_volume_snapshot.py +++ b/plugins/modules/os_volume_snapshot.py @@ -45,7 +45,7 @@ options: description: - Availability zone in which to create the snapshot. requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" extends_documentation_fragment: diff --git a/plugins/modules/os_zone.py b/plugins/modules/os_zone.py index acbf4666..008702ef 100644 --- a/plugins/modules/os_zone.py +++ b/plugins/modules/os_zone.py @@ -47,7 +47,7 @@ options: description: - Ignored. Present for backwards compatibility requirements: - - "python >= 2.7" + - "python >= 3.6"" - "openstacksdk" extends_documentation_fragment: diff --git a/tox.ini b/tox.ini index 6f8c1906..104f5931 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,8 @@ ignore_basepython_conflict = True [testenv] skip_install = True -install_command = pip3 install {opts} {packages} +install_command = python -m pip install {opts} {packages} +basepython = python3 passenv = OS_* setenv = VIRTUAL_ENV={envdir}