def clean_orphaned_vdis(xenapi, vdi_uuids):
 for vdi_uuid in vdi_uuids:
  if CONF.verbose:
   print ('CLEANING VDI (%s)' % vdi_uuid)
  vdi_ref = call_xenapi(xenapi, 'VDI.get_by_uuid', vdi_uuid)
  try:
   call_xenapi(xenapi, 'VDI.destroy', vdi_ref)
  except XenAPI.Failure as exc:
   sys.stderr.write(('Skipping %s: %s' % (vdi_uuid, exc)))

def clean_orphaned_vdis ( xenapi , vdi_uuids ) : for vdi_uuid in vdi_uuids : if CONF . verbose : print ( 'CLEANING VDI (%s)' % vdi_uuid ) vdi_ref = call_xenapi ( xenapi , 'VDI.get_by_uuid' , vdi_uuid ) try : call_xenapi ( xenapi , 'VDI.destroy' , vdi_ref ) except XenAPI . Failure as exc : sys . stderr . write ( ( 'Skipping %s: %s' % ( vdi_uuid , exc ) ) )
clean orphaned vdis .