def puller():
    "Thread-based puller.\n \n    Gets image name from the queue and attempts to pull the image. Any issues, except\n    for NotFound, are retried up to num_retries times. Once the image has been pulled, it's not found or the\n    retries have been exceeded, the queue task is marked as done.\n    "
    while True:
        image_name = name_queue.get()
        if (image_name is None):
            break
        i = 0
        while (i < num_retries):
            try:
                pull_image(image_name)
                break
            except APIError as ex:
                i += 1
                if (i < num_retries):
                    logger.warning("Attempt {} to pull image '{}' encountered exception - retrying.  Exception was: {}".format(i, image_name, ex))
                else:
                    logger.error("Attempt {} to pull image '{}' failed with exception: {}".format(i, image_name, ex))
        name_queue.task_done()
Thread-based puller.

Gets image name from the queue and attempts to pull the image. Any issues, except
for NotFound, are retried up to num_retries times. Once the image has been pulled, it's not found or the
retries have been exceeded, the queue task is marked as done.
def puller():
    "Thread-based puller.\n \n    Gets image name from the queue and attempts to pull the image. Any issues, except\n    for NotFound, are retried up to num_retries times. Once the image has been pulled, it's not found or the\n    retries have been exceeded, the queue task is marked as done.\n    "
    while True:
        image_name = name_queue.get()
        if (image_name is None):
            break
        i = 0
        while (i < num_retries):
            try:
                pull_image(image_name)
                break
            except APIError as ex:
                i += 1
                if (i < num_retries):
                    logger.warning("Attempt {} to pull image '{}' encountered exception - retrying.  Exception was: {}".format(i, image_name, ex))
                else:
                    logger.error("Attempt {} to pull image '{}' failed with exception: {}".format(i, image_name, ex))
        name_queue.task_done()