mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 11:18:11 +00:00
Merge pull request #1351 from acaudwell/udp-ports-fix
Don't release NIO UDP ports when updating docker container.
This commit is contained in:
commit
72cc3961dd
@ -386,7 +386,8 @@ class DockerVM(BaseNode):
|
|||||||
aux = self.aux
|
aux = self.aux
|
||||||
state = yield from self._get_container_state()
|
state = yield from self._get_container_state()
|
||||||
|
|
||||||
yield from self.reset()
|
# reset the docker container, but don't release the NIO UDP ports
|
||||||
|
yield from self.reset(False)
|
||||||
yield from self.create()
|
yield from self.create()
|
||||||
self.console = console
|
self.console = console
|
||||||
self.aux = aux
|
self.aux = aux
|
||||||
@ -680,7 +681,8 @@ class DockerVM(BaseNode):
|
|||||||
yield from self.reset()
|
yield from self.reset()
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def reset(self):
|
def reset(self, release_nio_udp_ports=True):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
state = yield from self._get_container_state()
|
state = yield from self._get_container_state()
|
||||||
if state == "paused" or state == "running":
|
if state == "paused" or state == "running":
|
||||||
@ -706,6 +708,7 @@ class DockerVM(BaseNode):
|
|||||||
log.info("Docker container '{name}' [{image}] removed".format(
|
log.info("Docker container '{name}' [{image}] removed".format(
|
||||||
name=self._name, image=self._image))
|
name=self._name, image=self._image))
|
||||||
|
|
||||||
|
if release_nio_udp_ports:
|
||||||
for adapter in self._ethernet_adapters:
|
for adapter in self._ethernet_adapters:
|
||||||
if adapter is not None:
|
if adapter is not None:
|
||||||
for nio in adapter.ports.values():
|
for nio in adapter.ports.values():
|
||||||
|
Loading…
Reference in New Issue
Block a user