Merge branch '2.0' into 2.1

This commit is contained in:
Julien Duponchelle committed 2017-02-28 14:25:38 +01:00
commit 1ab9ca2333
29 files changed
+548 -55

No files matched your search

@@ -211,7 +211,8 @@ class EthernetSwitch(Device):
nio = self._nios[port_number]
if isinstance(nio, NIOUDP):
self.manager.port_manager.release_udp_port(nio.lport, self._project)
yield from self._hypervisor.send('ethsw remove_nio "{name}" {nio}'.format(name=self._name, nio=nio))
if self._hypervisor:
yield from self._hypervisor.send('ethsw remove_nio "{name}" {nio}'.format(name=self._name, nio=nio))
log.info('Ethernet switch "{name}" [{id}]: NIO {nio} removed from port {port}'.format(name=self._name,
id=self._id,
+2 -1
View File
@@ -24,6 +24,7 @@ import asyncio
import time
import sys
import os
import re
import glob
import shlex
import base64
@@ -1474,7 +1475,7 @@ class Router(BaseNode):
try:
with open(startup_config_path, "r+", encoding="utf-8", errors="replace") as f:
old_config = f.read()
new_config = old_config.replace(self.name, new_name)
new_config = re.sub(r"^hostname .+$", "hostname " + new_name, old_config, flags=re.MULTILINE)
f.seek(0)
f.write(new_config)
except OSError as e: