Rename KeystoneAuth to KeystoneAuthV2

This makes it more explicit that we're using keystone authentication
v2.0
This commit is contained in:
Douglas Mendizabal
2013-09-04 16:22:18 -05:00
parent 67aace449f
commit dfa9eba7ae
3 changed files with 8 additions and 6 deletions

View File

@@ -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]):

View File

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

View File

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