mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-31 05:13:49 +02: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 asyncio
|
||||||
import subprocess
|
import subprocess
|
||||||
import logging
|
import logging
|
||||||
|
import aiohttp
|
||||||
import docker
|
import docker
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@ -126,7 +127,7 @@ class Docker(BaseManager):
|
|||||||
|
|
||||||
if cid not in self._vms:
|
if cid not in self._vms:
|
||||||
raise aiohttp.web.HTTPNotFound(
|
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]
|
container = self._vms[cid]
|
||||||
if project_id:
|
if project_id:
|
||||||
|
@ -128,7 +128,7 @@ class Container(BaseVM):
|
|||||||
def stop(self):
|
def stop(self):
|
||||||
"""Stops this Docker container."""
|
"""Stops this Docker container."""
|
||||||
result = yield from self.manager.execute(
|
result = yield from self.manager.execute(
|
||||||
"stop", {"container": self._id})
|
"kill", {"container": self._id})
|
||||||
log.info("Docker container '{name}' [{image}] stopped".format(
|
log.info("Docker container '{name}' [{image}] stopped".format(
|
||||||
name=self._name, image=self._image))
|
name=self._name, image=self._image))
|
||||||
|
|
||||||
|
@ -42,6 +42,11 @@ DOCKER_CREATE_SCHEMA = {
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"minLength": 1,
|
"minLength": 1,
|
||||||
},
|
},
|
||||||
|
"console": {
|
||||||
|
"description": "console name",
|
||||||
|
"type": "string",
|
||||||
|
"minLength": 1,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
"additionalProperties": False,
|
"additionalProperties": False,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user