Change in vdsm[master]: NetReload: netmodels for addNetwork
gvallare at redhat.com
gvallare at redhat.com
Sun May 26 10:13:09 UTC 2013
Giuseppe Vallarelli has posted comments on this change.
Change subject: NetReload: netmodels for addNetwork
......................................................................
Patch Set 7: I would prefer that you didn't submit this
(3 inline comments)
See comments specific comments.
....................................................
File vdsm/configNetwork.py
Line 47: MAX_BRIDGE_NAME_LEN = 15
Line 48: ILLEGAL_BRIDGE_CHARS = frozenset(':. \t')
Line 49:
Line 50:
Line 51: def objectivizeNetwork(bridge=None, vlan=None, bonding=None,
Instead of objectivizeSomething can you change it to buildSomething or createSomething (same applies to the different models). Adding a docstring would be cool and responsible, you should explain what the object returned represents, if I remember correctly is this a configuration that a user wants to apply? In this case also createNetwork is still a generic name which doesn't convey the real meaning.
Line 52: bondingOptions=None, nics=None, mtu=None, ipaddr=None,
Line 53: netmask=None, gateway=None, bootproto=None,
Line 54: _netinfo=None, configurator=None, **opts):
Line 55: if configurator is None:
Line 76: if bridge:
Line 77: topObj = Bridge(bridge, configurator, ports=[topObj] if topObj else [],
Line 78: mtu=mtu, stp=opts.get('stp'),
Line 79: forwardDelay=opts.get('forward_delay', 0))
Line 80: topObj.ip = IpConfig(inet=IPv4(ipaddr, netmask, gateway),
topObj can still be None, if a user of this function doesn't specifiy bonding, nics, etc.. Can you add also a test ?
Line 81: bootproto=bootproto)
Line 82: return topObj
Line 83:
Line 84:
....................................................
File vdsm/netmodels.py
Line 27: from vdsm import netinfo
Line 28: import neterrors as ne
Line 29:
Line 30:
Line 31: class NetDevice(object):
I think you should move in NetDevice the configure method (not implemented) so you make clear that every subclass of NetDevice should implement a configure method.
Line 32: def __init__(self, name, configurator, ipconfig=None, mtu=None):
Line 33: self.name = name
Line 34: self.ip = ipconfig
Line 35: self.mtu = mtu
--
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: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <gvallare at redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw at linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
More information about the vdsm-patches
mailing list