Antoni Segura Puimedon has posted comments on this change. Change subject: NetReload: netmodels for addNetwork ......................................................................
Patch Set 3: (2 inline comments) .................................................... File lib/vdsm/netinfo.py Line 190: Line 191: Line 192: def prefix2netmask(prefix): Line 193: if not 0 <= prefix <= 32: Line 194: raise ValueError('%s is not a valid prefix value. It must be between ' This is new, but I since the behavior for the values outside the range is kind of undefined, I thought it worthy to add. Line 195: '0 and 32') Line 196: return socket.inet_ntoa( Line 197: struct.pack("!I", int('1' * prefix + '0' * (32 - prefix), 2))) Line 198: Line 196: return socket.inet_ntoa( Line 197: struct.pack("!I", int('1' * prefix + '0' * (32 - prefix), 2))) Line 198: Line 199: Line 200: def netmask2prefix(netmask): This is not yet used in this patch. I wouldn't be against moving it to a future patch. I liked the symmetry. Line 201: try: Line 202: socket.inet_pton(socket.AF_INET, netmask) Line 203: except socket.error: Line 204: raise ValueError('%s is not a valid netmask.' % netmask) -- To view, visit http://gerrit.ovirt.org/14303 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba5c5b84760e27245cbe34c3b290c54e51278e72 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Antoni Segura Puimedon <asegu...@redhat.com> Gerrit-Reviewer: Antoni Segura Puimedon <asegu...@redhat.com> Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com> Gerrit-Reviewer: Giuseppe Vallarelli <gvall...@redhat.com> Gerrit-Reviewer: Mark Wu <wu...@linux.vnet.ibm.com> Gerrit-Reviewer: oVirt Jenkins CI Server _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches