Use 'barbican_endpoint_type'config option to get endpoint from catalog

_get_barbican_endpoint now uses barbican_endpoint_type config option to
retrieve a correct endpoint from catalog.

This config option is set to 'public' by default and it's a default
value for ServiceCatalog.endpoint_data_for method. It means that the
default behaviour will be the same as before this patch.

Change-Id: Idf4061fe3e35e3c47a993a56b23c0257c92e5cc3
This commit is contained in:
Ivan Kolodyazhny 2020-07-31 13:45:46 +03:00
parent 62a826cf10
commit e63d813a70
2 changed files with 8 additions and 1 deletions

View File

@ -193,7 +193,8 @@ class BarbicanKeyManager(key_manager.KeyManager):
return barbican.barbican_endpoint
elif getattr(auth, 'service_catalog', None):
endpoint_data = auth.service_catalog.endpoint_data_for(
service_type='key-manager')
service_type='key-manager',
interface=barbican.barbican_endpoint_type)
return endpoint_data.url
else:
service_parameters = {'service_type': 'key-manager',

View File

@ -0,0 +1,6 @@
---
fixes:
- |
``barbican_endpoint_type`` is now used to retrieve Barbican endpoint URL
from service catalog. This config option is set to 'public' by default so
it will not change the current behaviour.