def list_users(iam_conn, path_prefix):
    """List IAM users."""

    users = []
    marker = None

    while True:
        if marker:
            response = iam_conn.list_users(PathPrefix=path_prefix,
                                           Marker=marker)
        else:
            response = iam_conn.list_users(PathPrefix=path_prefix)
        for user in response['Users']:
            users.append(user)
        if not response['IsTruncated']:
            break
        marker = response['Marker']

    return users