Fix the docker aux port is lost after an update

Fix https://github.com/GNS3/gns3-gui/issues/1155
pull/479/head
Julien Duponchelle 8 years ago
parent 36dbcfa7f6
commit 2651a48102
No known key found for this signature in database
GPG Key ID: F1E2485547D4595D

@ -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…
Cancel
Save