...
 
Commits (8)
......@@ -2,3 +2,4 @@
host=review.openstack.org
port=29418
project=openstack/neutron-vpnaas-dashboard.git
defaultbranch=stable/pike
- project:
templates:
- check-requirements
- openstack-python-jobs-horizon
- openstack-python35-jobs-horizon
- publish-openstack-sphinx-docs
- release-notes-jobs
......@@ -10,12 +10,6 @@ function install_neutron_vpnaas_dashboard {
function configure_neutron_vpnaas_dashboard {
cp -a $VPNAAS_ENABLED_DIR/_[0-9]*.py $HORIZON_ENABLED_DIR
# The following is to make vpnaas dashboard work with
# the master horizon with neutron vpnaas support.
# At now it seems overriding enabled file does not work.
# (horizon bug 1700325)
rm -f $DEST/horizon/openstack_dashboard/enabled/_1470_project_vpn_panel.py
rm -f $DEST/horizon/openstack_dashboard/enabled/__pycache__/_1470_project_vpn_panel.*
# NOTE: If locale directory does not exist, compilemessages will fail,
# so check for an existence of locale directory is required.
if [ -d $VPNAAS_DASHBOARD_DIR/neutron_vpnaas_dashboard/locale ]; then
......
......@@ -38,8 +38,8 @@ Enable the horizon plugin.
.. code-block:: console
$ cp neutron_vpnaas_dashboard/enabled/_1470_project_vpn_panel.py \
/opt/stack/horizon/openstack_dashboard/local/enabled/_1470_project_vpn_panel.py
$ cp neutron_vpnaas_dashboard/enabled/_7100_project_vpn_panel.py \
/opt/stack/horizon/openstack_dashboard/local/enabled/_7100_project_vpn_panel.py
.. note::
......
#!/usr/bin/env bash
# Client constraint file contains this client version pin that is in conflict
# with installing the client from source. We should remove the version pin in
# the constraints file before applying it for from-source installation.
# The script also has a secondary purpose to install certain special
# dependencies directly from git.
# Many of neutron's repos suffer from the problem of depending on neutron,
# but it not existing on pypi.
# Wrapper for pip install that always uses constraints.
function pip_install() {
pip install -c"$localfile" -U "$@"
}
# 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.
# Grab the library from git using either zuul-cloner or pip. The former is
# there to a take advantage of the setup done by the gate infrastructure
# and honour any/all Depends-On headers in the commit message
function install_from_git() {
ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner
GIT_HOST=git.openstack.org
PROJ=$1
EGG=$2
# From the tox.ini config page:
# install_command=ARGV
# default:
# pip install {opts} {packages}
edit-constraints "$localfile" -- "$EGG"
if [ -x "$ZUUL_CLONER" ]; then
SRC_DIR="$VIRTUAL_ENV/src"
mkdir -p "$SRC_DIR"
cd "$SRC_DIR" >/dev/null
ZUUL_CACHE_DIR=${ZUUL_CACHE_DIR:-/opt/git} $ZUUL_CLONER \
--branch "$BRANCH_NAME" \
"git://$GIT_HOST" "$PROJ"
pip_install -e "$PROJ/."
cd - >/dev/null
else
SRC_DIR="$VIRTUAL_ENV/src/$PROJ"
git clone --depth 1 --branch $BRANCH_NAME https://$GIT_HOST/$PROJ $SRC_DIR
pip_install -e $SRC_DIR
fi
}
ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner
BRANCH_NAME=stable/pike
GIT_BASE=${GIT_BASE:-https://git.openstack.org/}
install_project() {
local project=$1
local branch=${2:-$BRANCH_NAME}
local module_name=${project//-/_}
set +e
project_installed=$(echo "import $module_name" | python 2>/dev/null ; echo $?)
set -e
CONSTRAINTS_FILE="$1"
shift 1
if [ $project_installed -eq 0 ]; then
echo "ALREADY INSTALLED" > /tmp/tox_install.txt
echo "$project already installed; using existing package"
elif [ -x "$ZUUL_CLONER" ]; then
echo "ZUUL CLONER" > /tmp/tox_install.txt
# Make this relative to current working directory so that
# git clean can remove it. We cannot remove the directory directly
# since it is referenced after $install_cmd -e
mkdir -p .tmp
PROJECT_DIR=$(/bin/mktemp -d -p $(pwd)/.tmp)
pushd $PROJECT_DIR
$ZUUL_CLONER --cache-dir \
/opt/git \
--branch $branch \
http://git.openstack.org \
openstack/$project
cd openstack/$project
$install_cmd -e .
popd
else
echo "PIP HARDCODE" > /tmp/tox_install.txt
local GIT_REPO="$GIT_BASE/openstack/$project"
SRC_DIR="$VIRTUAL_ENV/src/$project"
git clone --depth 1 --branch $branch $GIT_REPO $SRC_DIR
$install_cmd -U -e $SRC_DIR
fi
}
# This script will either complete with a return code of 0 or the return code
# of whatever failed.
set -e
# NOTE(tonyb): Place this in the tox environment's log dir so it will get
# published to logs.openstack.org for easy debugging.
mkdir -p "$VIRTUAL_ENV/log/"
localfile="$VIRTUAL_ENV/log/upper-constraints.txt"
if [[ "$CONSTRAINTS_FILE" != http* ]]; then
CONSTRAINTS_FILE="file://$CONSTRAINTS_FILE"
fi
# NOTE(tonyb): need to add curl to bindep.txt if the project supports bindep
curl "$CONSTRAINTS_FILE" --insecure --progress-bar --output "$localfile"
pip_install openstack-requirements
# This is the main purpose of the script: Allow local installation of
# the current repo. It is listed in constraints file and thus any
# install will be constrained and we need to unconstrain it.
edit-constraints "$localfile" -- "$CLIENT_NAME"
install_cmd="pip install -c$1"
shift
declare -a passthrough_args
while [ $# -gt 0 ] ; do
case "$1" in
# If we have any special os:<repo_name:<egg_name> deps then process them
os:*)
declare -a pkg_spec
IFS=: pkg_spec=($1)
unset IFS
install_from_git "${pkg_spec[1]}" "${pkg_spec[2]}"
;;
# Otherwise just pass the other deps through to the constrained pip install
*)
passthrough_args+=("$1")
;;
esac
shift 1
done
install_project horizon
# If *only* had special args then then isn't any need to run pip.
if [ -n "$passthrough_args" ] ; then
pip_install "${passthrough_args[@]}"
if [ $# -ge 1 ]; then
$install_cmd -U $*
fi
exit $?
......@@ -5,10 +5,8 @@ skipsdist = True
[testenv]
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}
install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike} {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
BRANCH_NAME=master
CLIENT_NAME=neutron-vpnaas-dashboard
NOSE_WITH_OPENSTACK=1
NOSE_OPENSTACK_COLOR=1
NOSE_OPENSTACK_RED=0.05
......@@ -16,7 +14,6 @@ setenv = VIRTUAL_ENV={envdir}
NOSE_OPENSTACK_SHOW_ELAPSED=1
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
os:openstack/horizon:horizon
commands = {[unit_tests]commands}
[unit_tests]
......@@ -50,7 +47,7 @@ commands = python setup.py build_sphinx
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[flake8]
exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,node_modules
exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,node_modules,.tmp
# Enable the following hacking rules which are disabled by default
# H203 Use assertIs(Not)None to check for None
# H904 Delay string interpolations at logging calls
......