1
0
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:
Goran Cetusic 2015-06-15 19:30:09 +02:00 committed by Julien Duponchelle
parent 0ab95ae043
commit 9ee1d9d71a
3 changed files with 8 additions and 2 deletions

View File

@ -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:

View File

@ -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))

View File

@ -42,6 +42,11 @@ DOCKER_CREATE_SCHEMA = {
"type": "string",
"minLength": 1,
},
"console": {
"description": "console name",
"type": "string",
"minLength": 1,
},
},
"additionalProperties": False,
}