From 654c1f06d583965c4b5a2ae721a7b1f3786dc76a Mon Sep 17 00:00:00 2001 From: Erik Olof Gunnar Andersson Date: Wed, 25 Sep 2019 16:34:03 -0700 Subject: [PATCH] Fix designate driver not being fully region aware The admin part of the designate implementation, never passes the region or url to client. This means that it may fail in multi-region situations. We fix this by always passing the endpoint override to the client every-time it's instantiated. We also add an alternative uri for devstack when a designate-api port isn't set. Closes-Bug: #1845891 Change-Id: Ia86c3177f1c0a1909a35e55e63b60aec5167124d --- devstack/lib/dns | 9 ++++++++- neutron/services/externaldns/drivers/designate/driver.py | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/devstack/lib/dns b/devstack/lib/dns index 651c6881a61..5d4312d7046 100644 --- a/devstack/lib/dns +++ b/devstack/lib/dns @@ -3,7 +3,14 @@ function configure_dns_extension { } function configure_dns_integration { iniset $NEUTRON_CONF DEFAULT external_dns_driver designate - iniset $NEUTRON_CONF designate url "$DESIGNATE_SERVICE_PROTOCOL://$DESIGNATE_SERVICE_HOST:$DESIGNATE_SERVICE_PORT/v2" + + # Use new /dns based uri by default if no port is set. + if [[ -z "$DESIGNATE_SERVICE_PORT" ]]; then + iniset $NEUTRON_CONF designate url "$DESIGNATE_SERVICE_PROTOCOL://$DESIGNATE_SERVICE_HOST/dns/v2" + else + iniset $NEUTRON_CONF designate url "$DESIGNATE_SERVICE_PROTOCOL://$DESIGNATE_SERVICE_HOST:$DESIGNATE_SERVICE_PORT/v2" + fi + configure_keystone_authtoken_middleware $NEUTRON_CONF designate designate } function post_config_dns_extension { diff --git a/neutron/services/externaldns/drivers/designate/driver.py b/neutron/services/externaldns/drivers/designate/driver.py index 48a6ea0c105..baeedd9e80c 100644 --- a/neutron/services/externaldns/drivers/designate/driver.py +++ b/neutron/services/externaldns/drivers/designate/driver.py @@ -57,7 +57,8 @@ def get_clients(context): password=CONF.designate.admin_password, tenant_name=CONF.designate.admin_tenant_name, tenant_id=CONF.designate.admin_tenant_id) - admin_client = d_client.Client(session=_SESSION, auth=admin_auth) + admin_client = d_client.Client(session=_SESSION, auth=admin_auth, + endpoint_override=CONF.designate.url) return client, admin_client