mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-11-16 16:54:51 +02: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
|
||||
if not e.startswith("GNS3_"):
|
||||
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)
|
||||
|
||||
if self._console_type == "vnc":
|
||||
|
Loading…
Reference in New Issue
Block a user