def _connect_keystone(self):
"""Get an OpenStack Keystone (identity) client object."""
if self._keystone_version == 3:
return keystone_client.Client(session=self._keystone_session,
auth_url=self.auth_url)
else:
# Wow, the internal keystoneV2 implementation is terribly buggy. It
# needs both a separate Session object and the username, password
# again for things to work correctly. Plus, a manual call to
# authenticate() is also required if the service catalog needs
# to be queried.
keystone = keystone_client.Client(
session=self._keystone_session,
auth_url=self.auth_url,
username=self.username,
password=self.password,
project_name=self.project_name,
region_name=self.region_name)
keystone.authenticate()
return keystone
评论列表
文章目录