def destroy(self, instance, network_info, cleanup=True):
        """Destroy the VM. Also destroy the associated VHD disk files"""
        LOG.debug(_("Got request to destroy vm %s"), instance.name)
        vm = self._lookup(instance.name)
        if vm is None:
            return
        vm = self._conn.Msvm_ComputerSystem(ElementName=instance.name)[0]
        vs_man_svc = self._conn.Msvm_VirtualSystemManagementService()[0]
        #Stop the VM first.
        self._set_vm_state(instance.name, 'Disabled')
        vmsettings = vm.associators(
                         wmi_result_class='Msvm_VirtualSystemSettingData')
        rasds = vmsettings[0].associators(
                         wmi_result_class='MSVM_ResourceAllocationSettingData')
        disks = [r for r in rasds \
                    if r.ResourceSubType == 'Microsoft Virtual Hard Disk']
        diskfiles = []
        #Collect disk file information before destroying the VM.
        for disk in disks:
            diskfiles.extend([c for c in disk.Connection])
        #Nuke the VM. Does not destroy disks.
        (job, ret_val) = vs_man_svc.DestroyVirtualSystem(vm.path_())
        if ret_val == WMI_JOB_STATUS_STARTED:
            success = self._check_job_status(job)
        elif ret_val == 0:
            success = True
        if not success:
            raise Exception(instance.name % _('Failed to destroy vm %s'))
        #Delete associated vhd disk files.
        for disk in diskfiles:
            vhdfile = self._cim_conn.CIM_DataFile(Name=disk)
            for vf in vhdfile:
                vf.Delete()
                instance_name = instance.name
                LOG.debug(_("Del: disk %(vhdfile)s vm %(instance_name)s")
                        % locals())
dataset/ETHPy150Open nii-cloud/dodai-compute/nova/virt/hyperv.py/HyperVConnection.destroy/swapped operands of `%`