def list_things(iot_client, old_certificate_arn):
    """
    Creates a list of all things attached to the old certificate
    :param iot_client: the boto client to connect and execute
    IoT APIs
    :param old_certificate_arn: the old certificate arn
    :return: list of things
    """
    things_list = []
    response = iot_client.list_principal_things(
        principal=old_certificate_arn
    )
    things_list.append(response['things'])

    while 'nextToken' in response:
        response = iot_client.list_principal_things(
            nextToken=response['nextToken'],
            principal=old_certificate_arn
        )
        things_list.append(response['things'])

    return things_list