From 8d5632d0b93eb26f5691fba4fadf44f28f75f6dd Mon Sep 17 00:00:00 2001 From: Adit Sarfaty Date: Thu, 16 Aug 2018 14:10:34 +0300 Subject: [PATCH] Devstack: Use the right python version in cleanup Change-Id: I498de68226789bb6c33df4caf51bec56c6335a45 --- devstack/plugin.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index d509cc462e..5bc54ee7f0 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -21,6 +21,11 @@ GITDIR['vmware-nsxlib']=$DEST/vmware-nsxlib GITREPO['vmware-nsxlib']=${NSXLIB_REPO:-${GIT_BASE}/openstack/vmware-nsxlib.git} GITBRANCH['vmware-nsxlib']=${NSXLIB_BRANCH:-master} +PYTHON='python' +if [[ $USE_PYTHON3 == "True" ]]; then + PYTHON='python3' +fi + dir=${GITDIR['vmware-nsx']}/devstack if [[ "$1" == "stack" && "$2" == "install" ]]; then @@ -35,10 +40,10 @@ if [[ $Q_PLUGIN == 'vmware_nsx_v' ]]; then source $dir/lib/vmware_nsx_v if [[ "$1" == "unstack" ]]; then db_connection=$(iniget $NEUTRON_CONF database connection) - python $dir/tools/nsxv_cleanup.py --vsm-ip ${NSXV_MANAGER_URI/https:\/\/} --user $NSXV_USER --password $NSXV_PASSWORD --db-connection $db_connection + $PYTHON $dir/tools/nsxv_cleanup.py --vsm-ip ${NSXV_MANAGER_URI/https:\/\/} --user $NSXV_USER --password $NSXV_PASSWORD --db-connection $db_connection elif [[ "$1" == "clean" ]]; then if is_service_enabled q-svc || is_service_enabled neutron-api; then - python $dir/tools/nsxv_cleanup.py --vsm-ip ${NSXV_MANAGER_URI/https:\/\/} --user $NSXV_USER --password $NSXV_PASSWORD + $PYTHON $dir/tools/nsxv_cleanup.py --vsm-ip ${NSXV_MANAGER_URI/https:\/\/} --user $NSXV_USER --password $NSXV_PASSWORD fi fi @@ -64,11 +69,11 @@ elif [[ $Q_PLUGIN == 'vmware_nsx_v3' ]]; then IFS=',' NSX_MANAGER=($NSX_MANAGER) unset IFS - python $dir/tools/nsxv3_cleanup.py --mgr-ip $NSX_MANAGER --user $NSX_USER --password $NSX_PASSWORD --db-connection $db_connection + $PYTHON $dir/tools/nsxv3_cleanup.py --mgr-ip $NSX_MANAGER --user $NSX_USER --password $NSX_PASSWORD --db-connection $db_connection fi elif [[ "$1" == 'clean' ]]; then if is_service_enabled q-svc || is_service_enabled neutron-api; then - python $dir/tools/nsxv3_cleanup.py --mgr-ip $NSX_MANAGER --user $NSX_USER --password $NSX_PASSWORD + $PYTHON $dir/tools/nsxv3_cleanup.py --mgr-ip $NSX_MANAGER --user $NSX_USER --password $NSX_PASSWORD fi fi elif [[ $Q_PLUGIN == 'vmware_nsx_tvd' ]]; then @@ -85,19 +90,19 @@ elif [[ $Q_PLUGIN == 'vmware_nsx_tvd' ]]; then NSX_MANAGER=($NSX_MANAGER) unset IFS if [[ "$NSX_MANAGER" != "" ]]; then - python $dir/tools/nsxv3_cleanup.py --mgr-ip $NSX_MANAGER --user $NSX_USER --password $NSX_PASSWORD --db-connection $db_connection + $PYTHON $dir/tools/nsxv3_cleanup.py --mgr-ip $NSX_MANAGER --user $NSX_USER --password $NSX_PASSWORD --db-connection $db_connection fi if [[ "$NSXV_MANAGER_URI" != "" ]]; then - python $dir/tools/nsxv_cleanup.py --vsm-ip ${NSXV_MANAGER_URI/https:\/\/} --user $NSXV_USER --password $NSXV_PASSWORD --db-connection $db_connection + $PYTHON $dir/tools/nsxv_cleanup.py --vsm-ip ${NSXV_MANAGER_URI/https:\/\/} --user $NSXV_USER --password $NSXV_PASSWORD --db-connection $db_connection fi fi elif [[ "$1" == 'clean' ]]; then if is_service_enabled q-svc || is_service_enabled neutron-api; then if [[ "$NSX_MANAGER" != "" ]]; then - python $dir/tools/nsxv3_cleanup.py --mgr-ip $NSX_MANAGER --user $NSX_USER --password $NSX_PASSWORD + $PYTHON $dir/tools/nsxv3_cleanup.py --mgr-ip $NSX_MANAGER --user $NSX_USER --password $NSX_PASSWORD fi if [[ "$NSXV_MANAGER_URI" != "" ]]; then - python $dir/tools/nsxv_cleanup.py --vsm-ip ${NSXV_MANAGER_URI/https:\/\/} --user $NSXV_USER --password $NSXV_PASSWORD + $PYTHON $dir/tools/nsxv_cleanup.py --vsm-ip ${NSXV_MANAGER_URI/https:\/\/} --user $NSXV_USER --password $NSXV_PASSWORD fi fi fi