mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 11:18:11 +00:00
parent
74a7e630d3
commit
f3e9917479
@ -243,16 +243,20 @@ 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):
|
||||||
|
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()
|
yield from container.update()
|
||||||
container.updated()
|
container.updated()
|
||||||
response.json(container)
|
response.json(container)
|
||||||
|
Loading…
Reference in New Issue
Block a user