mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-24 17:28:08 +00:00
Fix the docker aux port is lost after an update
Fix https://github.com/GNS3/gns3-gui/issues/1155
This commit is contained in:
parent
36dbcfa7f6
commit
2651a48102
@ -269,11 +269,13 @@ class DockerVM(BaseVM):
|
||||
"""
|
||||
# We need to save the console and state and restore it
|
||||
console = self.console
|
||||
aux = self.aux
|
||||
state = yield from self._get_container_state()
|
||||
|
||||
yield from self.close()
|
||||
yield from self.create()
|
||||
self.console = console
|
||||
self.aux = aux
|
||||
if state == "running":
|
||||
yield from self.start()
|
||||
|
||||
|
@ -451,6 +451,7 @@ def test_update(loop, vm):
|
||||
}
|
||||
|
||||
original_console = vm.console
|
||||
original_aux = vm.aux
|
||||
|
||||
with asyncio_patch("gns3server.modules.docker.Docker.list_images", return_value=[{"image": "ubuntu"}]) as mock_list_images:
|
||||
with asyncio_patch("gns3server.modules.docker.DockerVM._get_container_state", return_value="stopped"):
|
||||
@ -481,6 +482,7 @@ def test_update(loop, vm):
|
||||
"Cmd": ["/bin/sh"]
|
||||
})
|
||||
assert vm.console == original_console
|
||||
assert vm.aux == original_aux
|
||||
|
||||
|
||||
def test_update_running(loop, vm):
|
||||
|
Loading…
Reference in New Issue
Block a user