From dc7c4cdf3f2f70f8b7421f06d5d48bff32d1ef3e Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Wed, 26 Sep 2018 19:04:59 -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: Ib45159432550c6c15a29443d8c786e8f28c1d0c4 Signed-off-by: Doug Hellmann Co-Authored-By: Bartosz Zurkowski --- tox.ini | 5 +++++ .../content/database_configurations/config_param_manager.py | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index efc7b47..49cf7db 100644 --- a/tox.ini +++ b/tox.ini @@ -17,9 +17,11 @@ commands = /bin/bash run_tests.sh -N --no-pep8 {posargs} setenv = DJANGO_SETTINGS_MODULE=trove_dashboard.test.settings [testenv:pep8] +basepython = python3 commands = flake8 [testenv:venv] +basepython = python3 commands = {posargs} [testenv:py35dj20] @@ -32,15 +34,18 @@ basepython = python2.7 commands = /bin/bash run_tests.sh -N --integration --selenium-headless {posargs} [testenv:cover] +basepython = python3 commands = python setup.py testr --coverage --testr-args='{posargs}' [testenv:docs] +basepython = python3 commands = python setup.py build_sphinx [testenv:debug] commands = oslo_debug_helper {posargs} [testenv:releasenotes] +basepython = python3 commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [flake8] diff --git a/trove_dashboard/content/database_configurations/config_param_manager.py b/trove_dashboard/content/database_configurations/config_param_manager.py index fe2ec90..ef82b17 100644 --- a/trove_dashboard/content/database_configurations/config_param_manager.py +++ b/trove_dashboard/content/database_configurations/config_param_manager.py @@ -19,6 +19,7 @@ from django.utils.translation import ugettext_lazy as _ from trove_dashboard import api from oslo_serialization import jsonutils +from six.moves import builtins def get(request, configuration_group_id): @@ -185,7 +186,7 @@ def adjust_type(data_type, value): if data_type == "float": new_value = float(value) elif data_type == "long": - new_value = long(value) + new_value = builtins.int(value) elif data_type == "integer": new_value = int(value) else: