mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 03:08:14 +00:00
Detect invalid environment variable and send a warning when creating a Docker node. Ref #2683
This commit is contained in:
parent
ae3515434c
commit
aea4ae808f
@ -347,6 +347,9 @@ class DockerVM(BaseNode):
|
||||
if self._environment:
|
||||
for e in self._environment.strip().split("\n"):
|
||||
e = e.strip()
|
||||
if e.split("=")[0] == "":
|
||||
self.project.emit("log.warning", {"message": "{} has invalid environment variable: {}".format(self.name, e)})
|
||||
continue
|
||||
if not e.startswith("GNS3_"):
|
||||
formatted = self._format_env(variables, e)
|
||||
params["Env"].append(formatted)
|
||||
|
Loading…
Reference in New Issue
Block a user