mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-18 06:18:08 +00:00
fixed the way docker containers are terminated
This commit is contained in:
parent
0ab95ae043
commit
9ee1d9d71a
@ -25,6 +25,7 @@ import shutil
|
||||
import asyncio
|
||||
import subprocess
|
||||
import logging
|
||||
import aiohttp
|
||||
import docker
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
@ -126,7 +127,7 @@ class Docker(BaseManager):
|
||||
|
||||
if cid not in self._vms:
|
||||
raise aiohttp.web.HTTPNotFound(
|
||||
text="Docker container with ID {} doesn't exist".format(vm_id))
|
||||
text="Docker container with ID {} doesn't exist".format(cid))
|
||||
|
||||
container = self._vms[cid]
|
||||
if project_id:
|
||||
|
@ -128,7 +128,7 @@ class Container(BaseVM):
|
||||
def stop(self):
|
||||
"""Stops this Docker container."""
|
||||
result = yield from self.manager.execute(
|
||||
"stop", {"container": self._id})
|
||||
"kill", {"container": self._id})
|
||||
log.info("Docker container '{name}' [{image}] stopped".format(
|
||||
name=self._name, image=self._image))
|
||||
|
||||
|
@ -42,6 +42,11 @@ DOCKER_CREATE_SCHEMA = {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
},
|
||||
"console": {
|
||||
"description": "console name",
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
},
|
||||
},
|
||||
"additionalProperties": False,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user