summaryrefslogtreecommitdiff
path: root/barbicanclient/common/auth.py
diff options
context:
space:
mode:
Diffstat (limited to 'barbicanclient/common/auth.py')
-rw-r--r--barbicanclient/common/auth.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/barbicanclient/common/auth.py b/barbicanclient/common/auth.py
index 2c91c58..c663191 100644
--- a/barbicanclient/common/auth.py
+++ b/barbicanclient/common/auth.py
@@ -17,6 +17,7 @@ import logging
from keystoneclient.v2_0 import client as ksclient
from keystoneclient import exceptions
+
LOG = logging.getLogger(__name__)
@@ -28,15 +29,15 @@ class AuthException(Exception):
class KeystoneAuthV2(object):
def __init__(self, auth_url='', username='', password='',
- tenant_name='', tenant_id='', insecure=False):
+ tenant_name='', tenant_id='', insecure=False, keystone=None):
if not all([auth_url, username, password, tenant_name or tenant_id]):
raise ValueError('Please provide auth_url, username, password,'
' and tenant_id or tenant_name)')
- self._keystone = ksclient.Client(username=username,
- password=password,
- tenant_name=tenant_name,
- auth_url=auth_url,
- insecure=insecure)
+ self._keystone = keystone or ksclient.Client(username=username,
+ password=password,
+ tenant_name=tenant_name,
+ auth_url=auth_url,
+ insecure=insecure)
self._barbican_url = None
#TODO(dmend): make these configurable
self._service_type = 'keystore'