def find_smallest_template(context, vdc):
    log.info("Looking for the smallest available template...")
    templates = sorted(vdc.listAvailableTemplates(),
            key=lambda t: t.getDiskFileSize())
    if len(templates) > 0:
        log.info("Found compatible template: %s" % templates[0].getName())
        return templates[0]
    else:
        log.info("No compatible template found")
        return None
Finds the smallest template available to the virtual datacenter
dataset/ETHPy150Open nacx/kahuna/kahuna/plugins/environment/cloud/compute.py/find_smallest_template