From aea4ae808f18a1031f0b438a7918658882893d6b Mon Sep 17 00:00:00 2001 From: grossmj Date: Tue, 19 Feb 2019 17:34:10 +0700 Subject: [PATCH] Detect invalid environment variable and send a warning when creating a Docker node. Ref #2683 --- gns3server/compute/docker/docker_vm.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gns3server/compute/docker/docker_vm.py b/gns3server/compute/docker/docker_vm.py index 1facaff7..b5476020 100644 --- a/gns3server/compute/docker/docker_vm.py +++ b/gns3server/compute/docker/docker_vm.py @@ -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)