Rename KeystoneAuth to KeystoneAuthV2
This makes it more explicit that we're using keystone authentication v2.0
This commit is contained in:
@@ -22,7 +22,7 @@ class AuthException(Exception):
|
||||
self.message = message
|
||||
|
||||
|
||||
class KeystoneAuth(object):
|
||||
class KeystoneAuthV2(object):
|
||||
def __init__(self, auth_url='', username='', password='',
|
||||
tenant_name='', tenant_id=''):
|
||||
if not all([auth_url, username, password, tenant_name or tenant_id]):
|
||||
|
||||
@@ -228,10 +228,12 @@ class Keep:
|
||||
tenant_id=args.os_tenant_id)
|
||||
elif all([args.os_auth_url, args.os_username, args.os_password,
|
||||
args.os_tenant_name]):
|
||||
self._keystone = auth.KeystoneAuth(auth_url=args.os_auth_url,
|
||||
username=args.os_username,
|
||||
password=args.os_password,
|
||||
tenant_name=args.os_tenant_name)
|
||||
self._keystone = auth.KeystoneAuthV2(
|
||||
auth_url=args.os_auth_url,
|
||||
username=args.os_username,
|
||||
password=args.os_password,
|
||||
tenant_name=args.os_tenant_name
|
||||
)
|
||||
self.client = client.Client(auth_plugin=self._keystone,
|
||||
endpoint=args.endpoint,
|
||||
tenant_id=args.tenant_id)
|
||||
|
||||
@@ -20,4 +20,4 @@ from barbicanclient.common import auth
|
||||
class WhenTestingKeystoneAuthentication(unittest.TestCase):
|
||||
def test_endpoint_username_password_tenant_are_required(self):
|
||||
with self.assertRaises(ValueError):
|
||||
keystone = auth.KeystoneAuth()
|
||||
keystone = auth.KeystoneAuthV2()
|
||||
|
||||
Reference in New Issue
Block a user