def remove_tenant_user(request, tenant_id, user_id):
 client = keystoneclient(request, admin=True)
 roles = client.roles.roles_for_user(user_id, tenant_id)
 for role in roles:
  client.roles.remove_user_role(user_id, role.id, tenant_id)

def remove_tenant_user ( request , tenant_id , user_id ) : client = keystoneclient ( request , admin = True ) roles = client . roles . roles_for_user ( user_id , tenant_id ) for role in roles : client . roles . remove_user_role ( user_id , role . id , tenant_id )
removes all roles from a user on a tenant .