Antoni Segura Puimedon has posted comments on this change.

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


Patch Set 12: (6 inline comments)

....................................................
File tests/configNetworkTests.py
Line 38:     return {'fakebridgenet': {'iface': 'fakebridge', 'bridged': True},
Line 39:             'fakenet': {'iface': 'fakeint', 'bridged': False}}
Line 40: 
Line 41: 
Line 42: def raiseInvalidOpException(*args, **kwargs):
Done
Line 43:     return Exception('Attempted to apply network configuration during 
unit'
Line 44:                      'testing.')
Line 45: 
Line 46: 


....................................................
File vdsm/netmodels.py
Line 52: class Nic(NetDevice):
Line 53:     @classmethod
Line 54:     def objectivize(cls, name, configurator, mtu, _netinfo):
Line 55:         if name not in _netinfo.nics:
Line 56:             raise ConfigNetworkError(ne.ERR_BAD_NIC, 'unknown nic: %s' 
% name)
Done
Line 57:         return cls(name, configurator,
Line 58:                    mtu=max(mtu, int(netinfo.getMtu(name))))
Line 59: 
Line 60:     def configure(self, network=None, bridge=None, bonding=None, 
vlan=None,


Line 106: 
Line 107: 
Line 108: class Bridge(NetDevice):
Line 109:     '''This class represents traditional kernel bridges.'''
Line 110:     MAX_BRIDGE_NAME_LEN = 15
Done
Line 111:     ILLEGAL_BRIDGE_CHARS = frozenset(':. \t')
Line 112: 
Line 113:     def __init__(self, name, configurator, ipconfig=None, mtu=None, 
port=None,
Line 114:                  forwardDelay=0, stp=None):


Line 118:         self.stp = stp
Line 119:         super(Bridge, self).__init__(name, configurator, ipconfig, 
mtu)
Line 120: 
Line 121:     def __repr__(self):
Line 122:         return 'Bridge(%s: %r)' % (self.name, self.ports)
Done
Line 123: 
Line 124:     def configure(self, network, **opts):
Line 125:         self.configurator.configureBridge(self, network=network, 
**opts)
Line 126: 


Line 245:         self.netmask = netmask
Line 246:         self.gateway = gateway
Line 247: 
Line 248:     def __str__(self):
Line 249:         return self.__repr__()
Right, I didn't know that :P
Line 250: 
Line 251:     def __repr__(self):
Line 252:         return 'IPv4(%s, %s, %s)' % (self.address, self.netmask, 
self.gateway)
Line 253: 


Line 298:     def getConfig(self):
Line 299:         try:
Line 300:             ipaddr = self.ip.inet.address
Line 301:             netmask = self.ip.inet.netmask
Line 302:             gateway = self.ip.inet.gateway
Done
Line 303:         except AttributeError:
Line 304:             ipaddr = netmask = gateway = None
Line 305:         bootproto = self.bootproto


--
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: 12
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: Livnat Peer <lp...@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

Reply via email to