Merge branch '1.5' into 2.0

This commit is contained in:
Julien Duponchelle
2016-05-19 13:32:30 +02:00
3 changed files with 69 additions and 25 deletions

View File

@ -68,6 +68,9 @@ class DockerVM(BaseNode):
console_resolution="1024x768", console_http_port=80, console_http_path="/"):
super().__init__(name, node_id, project, manager, console=console, aux=aux, allocate_aux=True, console_type=console_type)
# If no version is specified force latest
if ":" not in image:
image = "{}:latest".format(image)
self._image = image
self._start_command = start_command
self._environment = environment
@ -541,11 +544,16 @@ class DockerVM(BaseNode):
try:
if self.console_type == "vnc":
if self._x11vnc_process:
self._x11vnc_process.terminate()
self._xvfb_process.terminate()
yield from self._x11vnc_process.wait()
yield from self._xvfb_process.wait()
try:
self._x11vnc_process.terminate()
yield from self._x11vnc_process.wait()
except ProcessLookupError:
pass
try:
self._xvfb_process.terminate()
yield from self._xvfb_process.wait()
except ProcessLookupError:
pass
state = yield from self._get_container_state()
if state == "paused" or state == "running":
yield from self.stop()