mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-08 18:41:46 +00:00
parent
d98a7aac19
commit
e82862c69f
@ -486,7 +486,9 @@ class DockerVM(BaseVM):
|
|||||||
out.feed_eof()
|
out.feed_eof()
|
||||||
ws.close()
|
ws.close()
|
||||||
break
|
break
|
||||||
|
yield from self.stop()
|
||||||
|
|
||||||
|
@asyncio.coroutine
|
||||||
def is_running(self):
|
def is_running(self):
|
||||||
"""Checks if the container is running.
|
"""Checks if the container is running.
|
||||||
|
|
||||||
@ -530,8 +532,8 @@ class DockerVM(BaseVM):
|
|||||||
if state == "paused":
|
if state == "paused":
|
||||||
yield from self.unpause()
|
yield from self.unpause()
|
||||||
|
|
||||||
|
if state != "stopped":
|
||||||
yield from self._fix_permissions()
|
yield from self._fix_permissions()
|
||||||
|
|
||||||
# t=5 number of seconds to wait before killing the container
|
# t=5 number of seconds to wait before killing the container
|
||||||
try:
|
try:
|
||||||
yield from self.manager.query("POST", "containers/{}/stop".format(self._cid), params={"t": 5})
|
yield from self.manager.query("POST", "containers/{}/stop".format(self._cid), params={"t": 5})
|
||||||
@ -544,6 +546,7 @@ class DockerVM(BaseVM):
|
|||||||
except RuntimeError as e:
|
except RuntimeError as e:
|
||||||
log.debug("Docker runtime error when closing: {}".format(str(e)))
|
log.debug("Docker runtime error when closing: {}".format(str(e)))
|
||||||
return
|
return
|
||||||
|
self.status = "stopped"
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def pause(self):
|
def pause(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user