1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-24 17:28:08 +00:00

Fix move a docker restart it

Fix #832
This commit is contained in:
Julien Duponchelle 2016-12-14 19:21:50 +01:00
parent 74a7e630d3
commit f3e9917479
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -243,17 +243,21 @@ class DockerHandler:
docker_manager = Docker.instance() docker_manager = Docker.instance()
container = docker_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"]) container = docker_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
container.name = request.json.get("name", container.name)
container.console = request.json.get("console", container.console) props = [
container.aux = request.json.get("aux", container.aux) "name", "console", "aux", "console_type", "console_resolution",
container.console_type = request.json.get("console_type", container.console_type) "console_http_port", "console_http_path", "start_command",
container.console_resolution = request.json.get("console_resolution", container.console_resolution) "environment", "adapters"
container.console_http_port = request.json.get("console_http_port", container.console_http_port) ]
container.console_http_path = request.json.get("console_http_path", container.console_http_path)
container.start_command = request.json.get("start_command", container.start_command) changed = False
container.environment = request.json.get("environment", container.environment) for prop in props:
container.adapters = request.json.get("adapters", container.adapters) if prop in request.json and request.json[prop] != getattr(container, prop):
yield from container.update() setattr(container, prop, request.json[prop])
changed = True
# We don't call container.update for nothing because it will restart the container
if changed:
yield from container.update()
container.updated() container.updated()
response.json(container) response.json(container)