diff --git a/designate/backend/impl_pdns4.py b/designate/backend/impl_pdns4.py index a983d5b4f..aceb9c3f4 100644 --- a/designate/backend/impl_pdns4.py +++ b/designate/backend/impl_pdns4.py @@ -11,7 +11,7 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -import urlparse +from six.moves import urllib import requests from oslo_log import log as logging @@ -37,7 +37,7 @@ class PDNS4Backend(base.Backend): self.api_token = self.options.get('api_token') def _build_url(self, zone=''): - r_url = urlparse.urlparse(self.api_endpoint) + r_url = urllib.parse.urlparse(self.api_endpoint) return "%s://%s/api/v1/servers/localhost/zones%s%s" % ( r_url.scheme, r_url.netloc, '/' if zone else '', zone) diff --git a/designate/storage/impl_sqlalchemy/tables.py b/designate/storage/impl_sqlalchemy/tables.py index 259a8589b..b2f6f5e3f 100644 --- a/designate/storage/impl_sqlalchemy/tables.py +++ b/designate/storage/impl_sqlalchemy/tables.py @@ -29,7 +29,7 @@ CONF = cfg.CONF RESOURCE_STATUSES = ['ACTIVE', 'PENDING', 'DELETED', 'ERROR'] RECORD_TYPES = ['A', 'AAAA', 'CNAME', 'MX', 'SRV', 'TXT', 'SPF', 'NS', 'PTR', - 'SSHFP'] + 'SSHFP', 'SOA'] TASK_STATUSES = ['ACTIVE', 'PENDING', 'DELETED', 'ERROR', 'COMPLETE'] TSIG_ALGORITHMS = ['hmac-md5', 'hmac-sha1', 'hmac-sha224', 'hmac-sha256', 'hmac-sha384', 'hmac-sha512'] diff --git a/tools/tox_install.sh b/tools/tox_install.sh new file mode 100755 index 000000000..d664f36e6 --- /dev/null +++ b/tools/tox_install.sh @@ -0,0 +1,32 @@ +#!/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 $* +# NOTE(hieulq): eventlet workaround, remove when fixed in upper constraint +pip install eventlet===0.19.0 +exit $? \ No newline at end of file diff --git a/tox.ini b/tox.ini index 1662d8810..8cc32cc19 100644 --- a/tox.ini +++ b/tox.ini @@ -1,14 +1,17 @@ [tox] -minversion = 1.6 +minversion = 2.0 envlist = py35,py27,flake8 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?h=master} {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=master} {opts} {packages} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt setenv = + VIRTUAL_ENV={envdir} + BRANCH_NAME=master + CLIENT_NAME=eventlet PYTHONDONTWRITEBYTECODE=1 whitelist_externals = sh find