Change in vdsm[master]: vm: Libvirt quering after disk detach operation addition.

nsoffer at redhat.com nsoffer at redhat.com
Tue Sep 1 09:38:22 UTC 2015


Nir Soffer has posted comments on this change.

Change subject: vm: Libvirt quering after disk detach operation addition.
......................................................................


Patch Set 11:

(1 comment)

https://gerrit.ovirt.org/#/c/45138/11/vdsm/virt/vm.py
File vdsm/virt/vm.py:

Line 2664:                     raise TimeoutError("libvirt could not detach the disk.")
Line 2665: 
Line 2666:     def _isDriveAttached(self, drive):
Line 2667:         root = ET.fromstring(self._dom.XMLDesc(0))
Line 2668:         for disk in root.findall("./devices/disk[serial='%s']" % drive.serial):
> what about
It works, but it hides the intent of the code.

We just want to know if we get a list with one item or an empty list, so we should use:

    return bool(root.findall("./devices/disk[serial='%s']" % drive.serial))
Line 2669:             return True
Line 2670:         return False
Line 2671: 
Line 2672:     def _readPauseCode(self):


-- 
To view, visit https://gerrit.ovirt.org/45138
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I393ce55dd761ac825cb96bd499976fd74c366b09
Gerrit-PatchSet: 11
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Amit Aviram <aaviram at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Amit Aviram <aaviram at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list