Marcin Mirecki has posted comments on this change. Change subject: caps: replacing minidom with ElementTree in caps.py ......................................................................
Patch Set 11: (3 comments) https://gerrit.ovirt.org/#/c/41078/11/tests/capsTests.py File tests/capsTests.py: Line 229: Line 230: result = caps._findLiveSnapshotSupport(guests.next()) Line 231: self.assertTrue(result) Line 232: Line 233: def test_findLiveSnapshotSupport_badData(self): Unit test checking for the issue where no features found would result in exception instead of None returned. Line 234: # XML which completely does not fit the schema expected Line 235: caps_string = "<a><b></b></a>" Line 236: caps_data = ET.fromstring(caps_string) Line 237: result = caps._findLiveSnapshotSupport(caps_data) https://gerrit.ovirt.org/#/c/41078/11/vdsm/caps.py File vdsm/caps.py: Line 209: if capabilities is None: Line 210: capabilities = _getFreshCapsXMLStr() Line 211: Line 212: caps = ET.fromstring(capabilities) Line 213: host = caps.find('host') Replaced iter by find/findall, except for in loops. Line 214: cells = host.find('.//cells') Line 215: Line 216: sockets = set() Line 217: siblings = set() Line 243: Return type: None or boolean. Line 244: None if libvirt does not report the live Line 245: snapshot support (as in version <= 1.2.2), Line 246: ''' Line 247: features = guest.find('features') Added a unit test to check for the case Dan mentioned. Line 248: if not features: Line 249: return None Line 250: Line 251: for feature in features.iter(tag='disksnapshot'): -- To view, visit https://gerrit.ovirt.org/41078 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8c1ca58807515922347e2255c77b4f950decd619 Gerrit-PatchSet: 11 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Marcin Mirecki <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Francesco Romani <[email protected]> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Marcin Mirecki <[email protected]> Gerrit-Reviewer: Vinzenz Feenstra <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
