Change in vdsm[master]: Fix duplicate emulated machines returned

mhuntxu at gmail.com mhuntxu at gmail.com
Thu Nov 29 04:08:52 UTC 2012


Hunt Xu has posted comments on this change.

Change subject: Fix duplicate emulated machines returned
......................................................................


Patch Set 3: I would prefer that you didn't submit this

(2 inline comments)

....................................................
File tests/capsTests.py
Line 63: 
Line 64:     def testEmulatedMachines(self):
Line 65:         testPath = os.path.realpath(__file__)
Line 66:         dirName = os.path.split(testPath)[0]
Line 67:         path = os.path.join(dirName, "caps_libvirt.out")
You might also want to update caps_libvirt.out with duplicate returned emulated machines to see whether this patch works well
Line 68:         machines = caps._getEmulatedMachines(file(path).read())
Line 69:         expectedMachines = ['rhel6.3.0', 'pc', 'rhel6.2.0', 'rhel6.1.0',
Line 70:                             'rhel6.0.0', 'rhel5.5.0', 'rhel5.4.4', 'rhel5.4.0']
Line 71:         self.assertEqual(machines, expectedMachines)


....................................................
File vdsm/caps.py
Line 130:     if capabilities is None:
Line 131:         capabilities = _getCapsXMLStr()
Line 132:     caps = ET.fromstring(capabilities)
Line 133:     return [m.text for m in
Line 134:             caps.findall("guest/arch[@name='x86_64']/machine")]
I don't like the idea to import another module for this issue. If we only want to avoid duplicate items in the LIST, a simple list(set(LIST)) would be sufficient. In the old function, i.e., return list(set([m.firstChild.toxml() for m in guestTag.getElementsByTagName('machine')]))
Line 135: 
Line 136: 
Line 137: def _getAllCpuModels():
Line 138:     cpu_map = minidom.parseString(


--
To view, visit http://gerrit.ovirt.org/8208
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mark Wu <wudxw at linux.vnet.ibm.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Hunt Xu <mhuntxu at gmail.com>
Gerrit-Reviewer: Mark Wu <wudxw at linux.vnet.ibm.com>
Gerrit-Reviewer: Ryan Harper <ryanh at us.ibm.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server


More information about the vdsm-patches mailing list