Restart the container if running and you change the hostname

Fix #439
This commit is contained in:
Julien Duponchelle committed 2016-02-24 15:47:53 +01:00
1 parent fd18458588
commit 2d42f32d71
2 files changed
+42 -1

No files matched your search

+5 -1
View File
@@ -189,11 +189,15 @@ class DockerVM(BaseVM):
"""
Destroy an recreate the container with the new settings
"""
# We need to save the console port and restore it
# We need to save the console and state and restore it
console = self.console
state = yield from self._get_container_state()
yield from self.remove()
yield from self.create()
self.console = console
if state == "running":
yield from self.start()
@asyncio.coroutine
def start(self):