From a245fd5f8f6306ac171cfe8907b3b4bb99016a00 Mon Sep 17 00:00:00 2001
From: Doug Hellmann <doug@doughellmann.com>
Date: Wed, 6 Jun 2018 16:06:01 -0400
Subject: [PATCH] fix tox python3 overrides

We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: I59ac21cb0d34f0b6767c736d0419eb6b874efca1
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
---
 tox.ini | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tox.ini b/tox.ini
index f86a0be99a..04ae68bf2f 100644
--- a/tox.ini
+++ b/tox.ini
@@ -16,6 +16,7 @@ commands =
   stestr slowest
 
 [testenv:releasenotes]
+basepython = python3
 deps =
   -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
   -r{toxinidir}/requirements.txt
@@ -27,6 +28,7 @@ commands =
 whitelist_externals = rm
 
 [testenv:debug]
+basepython = python3
 commands = oslo_debug_helper {posargs}
 
 [testenv:debug-py27]
@@ -60,17 +62,21 @@ commands =
   {toxinidir}/tools/check_logging.sh {toxinidir}/manila
 
 [testenv:genconfig]
+basepython = python3
 whitelist_externals = bash
 commands =
   oslo-config-generator --config-file etc/oslo-config-generator/manila.conf
 
 [testenv:genpolicy]
+basepython = python3
 commands = oslopolicy-sample-generator --config-file=etc/manila/manila-policy-generator.conf
 
 [testenv:venv]
+basepython = python3
 commands = {posargs}
 
 [testenv:docs]
+basepython = python3
 deps =
   -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
   -r{toxinidir}/requirements.txt
@@ -83,6 +89,7 @@ commands =
 whitelist_externals = rm
 
 [testenv:cover]
+basepython = python3
 setenv =
     {[testenv]setenv}
     PYTHON=coverage run --source manila --parallel-mode
@@ -109,6 +116,7 @@ deps = -r{toxinidir}/requirements.txt
 commands = python tools/lintstack.py check
 
 [testenv:api-ref]
+basepython = python3
 # This environment is called from CI scripts to test and publish
 # the API Ref to developer.openstack.org.
 whitelist_externals = rm
@@ -117,6 +125,7 @@ commands =
   sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
 
 [testenv:dbrevision]
+basepython = python3
 deps = -r{toxinidir}/requirements.txt
 commands = alembic -c manila/db/migrations/alembic.ini revision -m ""{posargs}