Nir Soffer has posted comments on this change. Change subject: v2v: adding os support version for v2v ......................................................................
Patch Set 2: (5 comments) Ok, needs little tweaks http://gerrit.ovirt.org/#/c/36388/2/vdsm/v2v.py File vdsm/v2v.py: Line 25 Line 26 Line 27 Line 28 Line 29 This is pass is also unneeded, can be removed in another patch. Line 29: ''' Unexpected error while parsing libvirt domain xml ''' Line 30: pass Line 31: Line 32: Line 33: class NotSupported(ValueError): This is not value error. This should inherit from Exception. Line 34: ''' v2v is not supported current os version ''' Line 35: pass Line 36: Line 37: Line 31: Line 32: Line 33: class NotSupported(ValueError): Line 34: ''' v2v is not supported current os version ''' Line 35: pass You don't need this pass, the docstring makes this valid class as is. Line 36: Line 37: Line 38: def supported(): Line 39: if not (caps.getos() in (caps.OSName.RHEVH, caps.OSName.RHEL) Line 36: Line 37: Line 38: def supported(): Line 39: if not (caps.getos() in (caps.OSName.RHEVH, caps.OSName.RHEL) Line 40: and caps.osversion()['version'].startswith('6')): Better use: return not (caps.getos() in (caps.OSName.RHEVH, caps.OSName.RHEL) and caps.osversion()['version'].startswith('6')) Line 41: return False Line 42: return True Line 43: Line 44: Line 43: Line 44: Line 45: def get_external_vms(uri, username, password): Line 46: if not supported(): Line 47: raise NotSupported('') Empty line after raising make the flow clear. Line 48: conn = libvirtconnection.open_connection(uri=uri, Line 49: username=username, Line 50: passwd=password) Line 51: with closing(conn): -- To view, visit http://gerrit.ovirt.org/36388 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I99a343a9634a90502feff46caed2c05b6af93ad5 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Shahar Havivi <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Nir Soffer <[email protected]> Gerrit-Reviewer: Shahar Havivi <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
