Everything in OpenStack *must* be Python 3 supporting now, which means
it's time to remove the functionality that allows us to blacklist
packages that didn't support Python 3.
Change-Id: I7c8cf538ec88bd4056b0109f19671e3d65f5da3a
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
| ... | ... |
@@ -85,60 +85,8 @@ function pip_install_gr_extras {
|
| 85 | 85 |
pip_install $clean_name[$extras] |
| 86 | 86 |
} |
| 87 | 87 |
|
| 88 |
-# python3_enabled_for() assumes the service(s) specified as arguments are |
|
| 89 |
-# enabled for python 3 unless explicitly disabled. See python3_disabled_for(). |
|
| 90 |
-# |
|
| 91 |
-# Multiple services specified as arguments are ``OR``'ed together; the test |
|
| 92 |
-# is a short-circuit boolean, i.e it returns on the first match. |
|
| 93 |
-# |
|
| 94 |
-# python3_enabled_for dir [dir ...] |
|
| 95 |
-function python3_enabled_for {
|
|
| 96 |
- local xtrace |
|
| 97 |
- xtrace=$(set +o | grep xtrace) |
|
| 98 |
- set +o xtrace |
|
| 99 |
- |
|
| 100 |
- local enabled=1 |
|
| 101 |
- local dirs=$@ |
|
| 102 |
- local dir |
|
| 103 |
- for dir in ${dirs}; do
|
|
| 104 |
- if ! python3_disabled_for "${dir}"; then
|
|
| 105 |
- enabled=0 |
|
| 106 |
- fi |
|
| 107 |
- done |
|
| 108 |
- |
|
| 109 |
- $xtrace |
|
| 110 |
- return $enabled |
|
| 111 |
-} |
|
| 112 |
- |
|
| 113 |
-# python3_disabled_for() checks if the service(s) specified as arguments are |
|
| 114 |
-# disabled by the user in ``DISABLED_PYTHON3_PACKAGES``. |
|
| 115 |
-# |
|
| 116 |
-# Multiple services specified as arguments are ``OR``'ed together; the test |
|
| 117 |
-# is a short-circuit boolean, i.e it returns on the first match. |
|
| 118 |
-# |
|
| 119 |
-# Uses global ``DISABLED_PYTHON3_PACKAGES`` |
|
| 120 |
-# python3_disabled_for dir [dir ...] |
|
| 121 |
-function python3_disabled_for {
|
|
| 122 |
- local xtrace |
|
| 123 |
- xtrace=$(set +o | grep xtrace) |
|
| 124 |
- set +o xtrace |
|
| 125 |
- |
|
| 126 |
- local enabled=1 |
|
| 127 |
- local dirs=$@ |
|
| 128 |
- local dir |
|
| 129 |
- for dir in ${dirs}; do
|
|
| 130 |
- [[ ,${DISABLED_PYTHON3_PACKAGES}, =~ ,${dir}, ]] && enabled=0
|
|
| 131 |
- done |
|
| 132 |
- |
|
| 133 |
- $xtrace |
|
| 134 |
- return $enabled |
|
| 135 |
-} |
|
| 136 |
- |
|
| 137 | 88 |
# enable_python3_package() -- no-op for backwards compatibility |
| 138 | 89 |
# |
| 139 |
-# For example: |
|
| 140 |
-# enable_python3_package nova |
|
| 141 |
-# |
|
| 142 | 90 |
# enable_python3_package dir [dir ...] |
| 143 | 91 |
function enable_python3_package {
|
| 144 | 92 |
local xtrace |
| ... | ... |
@@ -150,25 +98,15 @@ function enable_python3_package {
|
| 150 | 150 |
$xtrace |
| 151 | 151 |
} |
| 152 | 152 |
|
| 153 |
-# disable_python3_package() adds the services passed as argument to |
|
| 154 |
-# the ``DISABLED_PYTHON3_PACKAGES`` list. |
|
| 155 |
-# |
|
| 156 |
-# For example: |
|
| 157 |
-# disable_python3_package swift |
|
| 153 |
+# disable_python3_package() -- no-op for backwards compatibility |
|
| 158 | 154 |
# |
| 159 |
-# Uses global ``DISABLED_PYTHON3_PACKAGES`` |
|
| 160 | 155 |
# disable_python3_package dir [dir ...] |
| 161 | 156 |
function disable_python3_package {
|
| 162 | 157 |
local xtrace |
| 163 | 158 |
xtrace=$(set +o | grep xtrace) |
| 164 | 159 |
set +o xtrace |
| 165 | 160 |
|
| 166 |
- local disabled_svcs="${DISABLED_PYTHON3_PACKAGES}"
|
|
| 167 |
- local dir |
|
| 168 |
- for dir in $@; do |
|
| 169 |
- disabled_svcs+=",$dir" |
|
| 170 |
- done |
|
| 171 |
- DISABLED_PYTHON3_PACKAGES=$(_cleanup_service_list "$disabled_svcs") |
|
| 161 |
+ echo "It is no longer possible to call disable_python3_package()." |
|
| 172 | 162 |
|
| 173 | 163 |
$xtrace |
| 174 | 164 |
} |
| ... | ... |
@@ -231,17 +169,9 @@ function pip_install {
|
| 231 | 231 |
# support for python3 in progress, but don't claim support |
| 232 | 232 |
# in their classifier |
| 233 | 233 |
echo "Check python version for : $package_dir" |
| 234 |
- if python3_disabled_for ${package_dir##*/}; then
|
|
| 235 |
- echo "Explicitly using $PYTHON2_VERSION version to install $package_dir based on DISABLED_PYTHON3_PACKAGES" |
|
| 236 |
- else |
|
| 237 |
- # For everything that is not explicitly blacklisted with |
|
| 238 |
- # DISABLED_PYTHON3_PACKAGES, assume it supports python3 |
|
| 239 |
- # and we will let pip sort out the install, regardless of |
|
| 240 |
- # the package being local or remote. |
|
| 241 |
- echo "Using $PYTHON3_VERSION version to install $package_dir based on default behavior" |
|
| 242 |
- sudo_pip="$sudo_pip LC_ALL=en_US.UTF-8" |
|
| 243 |
- cmd_pip=$(get_pip_command $PYTHON3_VERSION) |
|
| 244 |
- fi |
|
| 234 |
+ echo "Using $PYTHON3_VERSION version to install $package_dir based on default behavior" |
|
| 235 |
+ sudo_pip="$sudo_pip LC_ALL=en_US.UTF-8" |
|
| 236 |
+ cmd_pip=$(get_pip_command $PYTHON3_VERSION) |
|
| 245 | 237 |
fi |
| 246 | 238 |
fi |
| 247 | 239 |
|
| ... | ... |
@@ -138,10 +138,6 @@ fi |
| 138 | 138 |
# Control whether Python 3 should be used at all. |
| 139 | 139 |
export USE_PYTHON3=$(trueorfalse True USE_PYTHON3) |
| 140 | 140 |
|
| 141 |
-# Explicitly list services not to run under Python 3. See |
|
| 142 |
-# disable_python3_package to edit this variable. |
|
| 143 |
-export DISABLED_PYTHON3_PACKAGES="" |
|
| 144 |
- |
|
| 145 | 141 |
# When Python 3 is supported by an application, adding the specific |
| 146 | 142 |
# version of Python 3 to this variable will install the app using that |
| 147 | 143 |
# version of the interpreter instead of 2.7. |
| 148 | 144 |
deleted file mode 100755 |
| ... | ... |
@@ -1,25 +0,0 @@ |
| 1 |
-#!/usr/bin/env bash |
|
| 2 |
- |
|
| 3 |
-# Tests for DevStack INI functions |
|
| 4 |
- |
|
| 5 |
-TOP=$(cd $(dirname "$0")/.. && pwd) |
|
| 6 |
- |
|
| 7 |
-source $TOP/functions-common |
|
| 8 |
-source $TOP/inc/python |
|
| 9 |
- |
|
| 10 |
-source $TOP/tests/unittest.sh |
|
| 11 |
- |
|
| 12 |
-echo "Testing Python 3 functions" |
|
| 13 |
- |
|
| 14 |
-# Initialize variables manipulated by functions under test. |
|
| 15 |
-export DISABLED_PYTHON3_PACKAGES="" |
|
| 16 |
- |
|
| 17 |
-assert_true "should be enabled by default" python3_enabled_for testpackage1 |
|
| 18 |
- |
|
| 19 |
-assert_false "should not be disabled yet" python3_disabled_for testpackage2 |
|
| 20 |
- |
|
| 21 |
-disable_python3_package testpackage2 |
|
| 22 |
-assert_equal "$DISABLED_PYTHON3_PACKAGES" "testpackage2" "unexpected result" |
|
| 23 |
-assert_true "should be disabled" python3_disabled_for testpackage2 |
|
| 24 |
- |
|
| 25 |
-report_results |