mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-13 20:08:55 +00:00
Fix docker console port lost during update
Fix https://github.com/GNS3/gns3-gui/issues/1026
This commit is contained in:
parent
85b9620953
commit
01e2fcf225
@ -184,8 +184,11 @@ class DockerVM(BaseVM):
|
||||
"""
|
||||
Destroy an recreate the container with the new settings
|
||||
"""
|
||||
# We need to save the console port and restore it
|
||||
console = self.console
|
||||
yield from self.remove()
|
||||
yield from self.create()
|
||||
self.console = console
|
||||
|
||||
@asyncio.coroutine
|
||||
def start(self):
|
||||
|
@ -352,6 +352,9 @@ def test_update(loop, vm):
|
||||
"Id": "e90e34656806",
|
||||
"Warnings": []
|
||||
}
|
||||
|
||||
original_console = vm.console
|
||||
|
||||
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"):
|
||||
with asyncio_patch("gns3server.modules.docker.Docker.query", return_value=response) as mock_query:
|
||||
@ -373,6 +376,7 @@ def test_update(loop, vm):
|
||||
"Name": "test",
|
||||
"Image": "ubuntu"
|
||||
})
|
||||
assert vm.console == original_console
|
||||
|
||||
|
||||
def test_remove(loop, vm):
|
||||
|
Loading…
Reference in New Issue
Block a user