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
This commit is contained in:
Erik Olof Gunnar Andersson 2019-09-25 16:34:03 -07:00
parent 1c2e10f859
commit 654c1f06d5
2 changed files with 10 additions and 2 deletions

View File

@ -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 {

View File

@ -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