Remove rogue calls to str.upper in l7rules
This patch also fixes tox install for gate tests. Change-Id: Ie79a2ba4fc5d80973014551fa2b8d8bcf2a68e4a Closes-Bug: #1700778
This commit is contained in:
parent
d5da9d25ca
commit
420f889322
|
@ -294,7 +294,7 @@ def check_l7policy_attrs(attrs):
|
|||
|
||||
def get_l7rule_attrs(client_manager, parsed_args):
|
||||
attr_map = {
|
||||
'action': ('action', str.upper),
|
||||
'action': ('action', str),
|
||||
'project': (
|
||||
'project_id',
|
||||
'project',
|
||||
|
@ -315,7 +315,7 @@ def get_l7rule_attrs(client_manager, parsed_args):
|
|||
'value': ('value', str),
|
||||
'key': ('key', str),
|
||||
'type': ('type', str),
|
||||
'compare_type': ('compare_type', str.upper),
|
||||
'compare_type': ('compare_type', str),
|
||||
'enable': ('admin_state_up', lambda x: True),
|
||||
'disable': ('admin_state_up', lambda x: False)
|
||||
}
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
#!/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.
|
||||
|
||||
CONSTRAINTS_FILE=$1
|
||||
shift 1
|
||||
|
||||
set -e
|
||||
|
||||
# NOTE(tonyb): Place this in the tox enviroment's log dir so it will get
|
||||
# published to logs.openstack.org for easy debugging.
|
||||
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 -c$localfile 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
|
||||
|
||||
pip install -c$localfile -U $*
|
||||
exit $?
|
3
tox.ini
3
tox.ini
|
@ -5,10 +5,11 @@ skipsdist = True
|
|||
|
||||
[testenv]
|
||||
usedevelop = True
|
||||
install_command = pip install -c{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} {opts} {packages}
|
||||
setenv =
|
||||
VIRTUAL_ENV={envdir}
|
||||
PYTHONWARNINGS=default::DeprecationWarning
|
||||
CLIENT_NAME=python-octaviaclient
|
||||
deps = -r{toxinidir}/test-requirements.txt
|
||||
commands = python setup.py test --slowest --testr-args='{posargs}'
|
||||
|
||||
|
|
Loading…
Reference in New Issue