mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-09-27 22:30:11 +03:00
Support GNS3 variables in Docker environment variables. Fixes #2033
This commit is contained in:
parent
4891dc9eee
commit
7490be6d5e
@ -388,6 +388,12 @@ class DockerVM(BaseNode):
|
|||||||
continue
|
continue
|
||||||
if not e.startswith("GNS3_"):
|
if not e.startswith("GNS3_"):
|
||||||
formatted = self._format_env(variables, e)
|
formatted = self._format_env(variables, e)
|
||||||
|
vm_name = self._name.replace(",", ",,")
|
||||||
|
project_path = self.project.path.replace(",", ",,")
|
||||||
|
formatted = formatted.replace("%vm-name%", '"' + vm_name.replace('"', '\\"') + '"')
|
||||||
|
formatted = formatted.replace("%vm-id%", self._id)
|
||||||
|
formatted = formatted.replace("%project-id%", self.project.id)
|
||||||
|
formatted = formatted.replace("%project-path%", '"' + project_path.replace('"', '\\"') + '"')
|
||||||
params["Env"].append(formatted)
|
params["Env"].append(formatted)
|
||||||
|
|
||||||
if self._console_type == "vnc":
|
if self._console_type == "vnc":
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user