Merge branch '2.0' into 2.1

This commit is contained in:
Julien Duponchelle committed 2017-03-30 10:16:16 +02:00
commit 4f1b738ef5
275 files changed
+5384 -272

No files matched your search

@@ -88,7 +88,7 @@ class EthernetSwitch(Device):
:param ports: ports info
"""
if ports != self._ports:
if len(self._nios) > 0:
if len(self._nios) > 0 and len(ports) != len(self._ports):
raise NodeError("Can't modify a switch already connected.")
port_number = 0
@@ -99,6 +99,13 @@ class EthernetSwitch(Device):
self._ports = ports
@asyncio.coroutine
def update_port_settings(self):
for port_settings in self._ports:
port_number = port_settings["port_number"]
if port_number in self._nios and self._nios[port_number] is not None:
yield from self.set_port_settings(port_number, port_settings)
@asyncio.coroutine
def create(self):
@@ -239,10 +239,10 @@ class FrameRelaySwitch(Device):
"""
if port1 not in self._nios:
raise DynamipsError("Port {} is not allocated".format(port1))
return
if port2 not in self._nios:
raise DynamipsError("Port {} is not allocated".format(port2))
return
nio1 = self._nios[port1]
nio2 = self._nios[port2]