#NEWLINE# def _get_grant_revoke_params( self , role , user = None , group = None , project = None , domain = None ) : #NEWLINE# #INDENT# role = self . get_role ( role ) #NEWLINE# if ( role is None ) : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# data = { #NEWLINE# #INDENT# 'role' : role . id , #NEWLINE# #UNINDENT# } #NEWLINE# keystone_version = self . cloud_config . get_api_version ( 'identity' ) #NEWLINE# is_keystone_v2 = keystone_version . startswith ( '2' ) #NEWLINE# filters = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if ( ( not is_keystone_v2 ) and domain ) : #NEWLINE# #INDENT# filters [ 'domain_id' ] = data [ 'domain' ] = self . get_domain ( domain ) [ 'id' ] #NEWLINE# #UNINDENT# if user : #NEWLINE# #INDENT# data [ 'user' ] = self . get_user ( user , filters = filters ) #NEWLINE# #UNINDENT# if project : #NEWLINE# #INDENT# data . pop ( 'domain' , None ) #NEWLINE# data [ 'project' ] = self . get_project ( project , filters = filters ) #NEWLINE# #UNINDENT# if ( ( not is_keystone_v2 ) and group ) : #NEWLINE# #INDENT# data [ 'group' ] = self . get_group ( group , filters = filters ) #NEWLINE# #UNINDENT# return data