#NEWLINE# def delete_user_role( self , kuser_id , tenant_id , role_name ) : #NEWLINE# #INDENT# user = self . shell . keystone . users . find ( id = kuser_id ) #NEWLINE# tenant = self . shell . keystone . tenants . find ( id = tenant_id ) #NEWLINE# role = None #NEWLINE# if ( role_name . lower ( ) == 'admin' ) : #NEWLINE# #INDENT# role = self . get_admin_role ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# role = self . shell . keystone . roles . find ( name = role_name ) #NEWLINE# #UNINDENT# role_found = False #NEWLINE# user_roles = user . list_roles ( tenant . id ) #NEWLINE# for user_role in user_roles : #NEWLINE# #INDENT# if ( tenant_id . name == role . name ) : #NEWLINE# #INDENT# role_found = True #NEWLINE# #UNINDENT# #UNINDENT# if role_found : #NEWLINE# #INDENT# tenant . remove_user ( user , role ) #NEWLINE# #UNINDENT# return 1