def lookup_vm_vdis(session, vm_ref):
    # Firstly we get the VBDs, then the VDIs.
    # TODO(Armando): do we leave the read-only devices?
    vbd_refs = session.call_xenapi("VM.get_VBDs", vm_ref)
    vdi_refs = []
    if vbd_refs:
        for vbd_ref in vbd_refs:
            try:
                vdi_ref = session.call_xenapi("VBD.get_VDI", vbd_ref)
                # Test valid VDI
                vdi_uuid = session.call_xenapi("VDI.get_uuid", vdi_ref)
                LOG.debug('VDI %s is still available', vdi_uuid)
                vbd_other_config = session.call_xenapi("VBD.get_other_config",
                                                       vbd_ref)
                if not vbd_other_config.get('osvol'):
                    # This is not an attached volume
                    vdi_refs.append(vdi_ref)
            except session.XenAPI.Failure:
                LOG.exception(_LE('"Look for the VDIs failed'))
    return vdi_refs
Utility function to cleanup a temporary folder if still existing
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/virt/xenapi/vm_utils.py/lookup_vm_vdis--crossover with--dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/externals/joblib/pool.py/delete_folder