Avoid tox-install.sh

Instead of using tox-install.sh, we can install horizon and neutron
now directly from pypi - or use the current branch in CI system using
tox-siblings.

Update tox.ini for this change and add neutron to requirements file.

This commit includes the following unrelated changes
to pass the gate.
----------------------------------------
devstack: Use setup_develop to install

As this project is in the global requirements now,
we need to edit the constraints.

Change-Id: I44e05b4e7b6f1c15314799c4a1e8c22f79abb74a
----------------------------------------
Update after rpc create_connection removal

Recently neutron.common.rpc.create_connection has been removed. [1]

[1] I2f4b24ba732be47fc9911be1e24406fb1ffe821e

Closes-Bug: #1770851
Change-Id: Ie83299b7a280dab0d5dc9dc3304b5d6091b4a0cc
----------------------------------------

Co-Authored-By: YAMAMOTO Takashi <yamamoto@midokura.com>
Change-Id: Ifffca6361b1c3991481442053bf182bde3c2d44a
This commit is contained in:
Andreas Jaeger 2018-03-14 21:31:38 +01:00 committed by YAMAMOTO Takashi
parent e528a0ba81
commit b762ecf9e5
8 changed files with 8 additions and 74 deletions

View File

@ -19,7 +19,7 @@
function install_taas {
pip_install --no-deps --editable $TAAS_PLUGIN_PATH
setup_develop $TAAS_PLUGIN_PATH
}
function configure_taas_plugin {

View File

@ -118,7 +118,7 @@ class TaasOvsAgentRpcCallback(api.TaasAgentRpcCallbackMixin):
topics.TAAS_PLUGIN, self.conf.host)
endpoints = [self]
conn = n_rpc.create_connection()
conn = n_rpc.Connection()
conn.create_consumer(topics.TAAS_AGENT, endpoints, fanout=False)
conn.consume_in_threads()

View File

@ -33,7 +33,7 @@ class TaasRpcDriver(service_drivers.TaasBaseDriver):
LOG.debug("Loading TaasRpcDriver.")
super(TaasRpcDriver, self).__init__(service_plugin)
self.endpoints = [taas_agent_api.TaasCallbacks(service_plugin)]
self.conn = n_rpc.create_connection()
self.conn = n_rpc.Connection()
self.conn.create_consumer(topics.TAAS_PLUGIN,
self.endpoints, fanout=False)

View File

@ -39,7 +39,7 @@ class DummyError(Exception):
class TestTaasPlugin(testlib_api.SqlTestCase):
def setUp(self):
super(TestTaasPlugin, self).setUp()
mock.patch.object(n_rpc, 'create_connection', auto_spec=True).start()
mock.patch.object(n_rpc, 'Connection', auto_spec=True).start()
mock.patch.object(taas_agent_api,
'TaasCallbacks', auto_spec=True).start()
mock.patch.object(taas_agent_api,

View File

@ -4,3 +4,4 @@
pbr!=2.1.0,>=2.0.0 # Apache-2.0
Babel!=2.4.0,>=2.3.4 # BSD
neutron>=12.0.0 # Apache-2.0

View File

@ -1,16 +0,0 @@
#! /bin/sh
set -e
DIR=$(dirname $0)
${DIR}/tox_install_project.sh neutron neutron $*
CONSTRAINTS_FILE=$1
shift
install_cmd="pip install"
if [ $CONSTRAINTS_FILE != "unconstrained" ]; then
install_cmd="$install_cmd -c$CONSTRAINTS_FILE"
fi
$install_cmd -U $*

View File

@ -1,52 +0,0 @@
#!/bin/sh
# Many of neutron's repos suffer from the problem of depending on neutron,
# but it not existing on pypi.
# This wrapper for tox's package installer will use the existing package
# if it exists, else use zuul-cloner if that program exists, else grab it
# from neutron master via a hard-coded URL. That last case should only
# happen with devs running unit tests locally.
# From the tox.ini config page:
# install_command=ARGV
# default:
# pip install {opts} {packages}
PROJ=$1
MOD=$2
shift 2
ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner
neutron_installed=$(echo "import ${MOD}" | python 2>/dev/null ; echo $?)
BRANCH_NAME=master
set -e
CONSTRAINTS_FILE=$1
shift
install_cmd="pip install"
if [ $CONSTRAINTS_FILE != "unconstrained" ]; then
install_cmd="$install_cmd -c$CONSTRAINTS_FILE"
fi
if [ $neutron_installed -eq 0 ]; then
echo "ALREADY INSTALLED" > /tmp/tox_install-${PROJ}.txt
echo "${PROJ} already installed; using existing package"
elif [ -x "$ZUUL_CLONER" ]; then
echo "ZUUL CLONER" > /tmp/tox_install-${PROJ}.txt
cwd=$(/bin/pwd)
cd /tmp
$ZUUL_CLONER --cache-dir \
/opt/git \
--branch ${BRANCH_NAME} \
git://git.openstack.org \
openstack/${PROJ}
cd openstack/${PROJ}
$install_cmd -e .
cd "$cwd"
else
echo "PIP HARDCODE" > /tmp/tox_install-${PROJ}.txt
$install_cmd -U -egit+https://git.openstack.org/openstack/${PROJ}@${BRANCH_NAME}#egg=${PROJ}
fi

View File

@ -7,8 +7,9 @@ skipsdist = True
setenv = VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
usedevelop = True
install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
deps = -r{toxinidir}/requirements.txt
install_command = pip install {opts} {packages}
deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = find . -type f -name "*.py[c|o]" -delete
find . -type d -name "__pycache__" -delete