Support GNS3 variables in Docker environment variables. Fixes #2033

This commit is contained in:
grossmj 2022-02-23 14:33:30 +10:30
parent 4891dc9eee
commit 7490be6d5e

View File

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