def _image_uses_bittorrent(context, instance):
    bittorrent = False
    torrent_images = CONF.xenserver.torrent_images.lower()

    if torrent_images == 'all':
        bittorrent = True
    elif torrent_images == 'some':
        sys_meta = utils.instance_sys_meta(instance)
        try:
            bittorrent = strutils.bool_from_string(
                sys_meta['image_bittorrent'])
        except __HOLE__:
            pass
    elif torrent_images == 'none':
        pass
    else:
        LOG.warning(_LW("Invalid value '%s' for torrent_images"),
                    torrent_images)

    return bittorrent
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/virt/xenapi/vm_utils.py/_image_uses_bittorrent