#NEWLINE# def list_role_assignments( self , filters = None ) : #NEWLINE# #INDENT# "List Keystone role assignments\n\n        :param dict filters: Dict of filter conditions. Acceptable keys are::\n\n            - 'user' (string) - User ID to be used as query filter.\n            - 'group' (string) - Group ID to be used as query filter.\n            - 'project' (string) - Project ID to be used as query filter.\n            - 'domain' (string) - Domain ID to be used as query filter.\n            - 'role' (string) - Role ID to be used as query filter.\n            - 'os_inherit_extension_inherited_to' (string) - Return inherited\n              role assignments for either 'projects' or 'domains'\n            - 'effective' (boolean) - Return effective role assignments.\n            - 'include_subtree' (boolean) - Include subtree\n\n            'user' and 'group' are mutually exclusive, as are 'domain' and\n            'project'.\n\n        NOTE: For keystone v2, only user, project, and role are used.\n              Project and user are both required in filters.\n\n        :returns: a list of dicts containing the role assignment description.\n            Contains the following attributes::\n\n                - id: <role id>\n                - user|group: <user or group id>\n                - project|domain: <project or domain id>\n\n        :raises: ``OpenStackCloudException``: if something goes wrong during\n            the openstack API call.\n        " #NEWLINE# if ( not filters ) : #NEWLINE# #INDENT# filters = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# if self . cloud_config . get_api_version ( 'identity' ) . startswith ( '2' ) : #NEWLINE# #INDENT# if ( ( filters . get ( 'project' ) is None ) or ( filters . get ( 'user' ) is None ) ) : #NEWLINE# #INDENT# raise OpenStackCloudException ( 'Must provide project and user for keystone v2' ) #NEWLINE# #UNINDENT# assignments = self . _keystone_v2_role_assignments ( ** filters ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# with _utils . shade_exceptions ( 'Failed to list role assignments' ) : #NEWLINE# #INDENT# assignments = self . manager . submitTask ( _tasks . RoleAssignmentList ( ** assignments ) ) #NEWLINE# #UNINDENT# #UNINDENT# return _utils . normalize_role_assignments ( assignments )