if os_creds:
keystone = keystone_client(os_creds)
else:
- raise Exception('Cannot lookup project without the proper '
- 'credentials')
+ raise KeystoneException(
+ 'Cannot lookup project without the proper credentials')
if keystone.version == V2_VERSION:
projects = keystone.tenants.list()
keystone.roles.add_user_role(user, os_role, tenant=project)
else:
keystone.roles.grant(os_role, user=user, project=project)
+
+
+class KeystoneException(Exception):
+ """
+ Exception when calls to the Keystone client cannot be served properly
+ """