Adding "region and endpoint_type" parameters to barbican_acl.py

When requesting for a barbican client, this change lets you filter based on
region and endpoint_type.

Change-Id: I78ba726dcd921a6344bfc88c832f19e11fb4d781
This commit is contained in:
Aishwarya Thangappa 2016-01-22 15:10:18 -07:00
parent 860d7b73b3
commit d596d513bf
2 changed files with 11 additions and 1 deletions

View File

@ -17,6 +17,7 @@
Barbican ACL auth class for Barbican certificate handling
"""
from barbicanclient import client as barbican_client
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
@ -26,6 +27,8 @@ from neutron_lbaas.common import keystone
LOG = logging.getLogger(__name__)
CONF = cfg.CONF
class BarbicanACLAuth(common.BarbicanAuth):
_barbican_client = None
@ -35,7 +38,9 @@ class BarbicanACLAuth(common.BarbicanAuth):
if not cls._barbican_client:
try:
cls._barbican_client = barbican_client.Client(
session=keystone.get_session()
session=keystone.get_session(),
region_name=CONF.service_auth.region,
interface=CONF.service_auth.endpoint_type
)
except Exception:
with excutils.save_and_reraise_exception():

View File

@ -70,6 +70,11 @@ OPTS = [
'auth_version',
default='2',
help=_('The auth version used to authenticate'),
),
cfg.StrOpt(
'endpoint_type',
default='public',
help=_('The endpoint_type to be used')
)
]