Change in vdsm[master]: NetReload: netmodels for addNetwork

gvallare at redhat.com gvallare at redhat.com
Mon Apr 29 07:37:01 UTC 2013


Giuseppe Vallarelli has posted comments on this change.

Change subject: NetReload: netmodels for addNetwork
......................................................................


Patch Set 2: (3 inline comments)

....................................................
File lib/vdsm/netinfo.py
Line 139:     for nic in nics:
Line 140:         mtuval = int(getMtu(nic))
Line 141:         if mtuval > mtu:
Line 142:             mtu = mtuval
Line 143:     return mtu
I just noticed that this has been moved. Sure I will.
Line 144: 
Line 145: 
Line 146: def bridge_stp_state(bridge):
Line 147:     stp = file('/sys/class/net/%s/bridge/stp_state' % bridge).readline()


....................................................
File tests/configNetworkTests.py
Line 50:         with self.assertRaises(neterrors.ConfigNetworkError) as cneContext:
Line 51:             configNetwork.addNetwork(netName, **opts)
Line 52:         self.assertEqual(cneContext.exception.errCode, errCode)
Line 53: 
Line 54:     # Monkey patch the real network detection from the netinfo module.
Cool :)
Line 55:     @MonkeyPatch(netinfo, 'networks', _fakeNetworks)
Line 56:     @MonkeyPatch(netinfo, 'getMaxMtu', lambda *x: 1500)
Line 57:     @MonkeyPatch(netconf.ifcfg, 'ifdown', lambda *x: raiseInvalidOpException())
Line 58:     @MonkeyPatch(netconf.ifcfg, 'ifup', lambda *x: raiseInvalidOpException())


....................................................
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(net, bridged=None, vlan=None, bonding=None,
It's more complex now, having smaller validation functions is not a bad idea.
Can you refactor it? Thanks.
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:


--
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: 2
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