From f4f9e6eba6e8acdde302b97ce21c1c1f7956e708 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Fri, 19 Feb 2016 17:01:28 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20Docker=20has=20returned=20an=20error:=205?= =?UTF-8?q?00=C2=A0b'No=20command=20specified'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #433 --- gns3server/modules/docker/docker_vm.py | 6 +++++- tests/modules/docker/test_docker_vm.py | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/gns3server/modules/docker/docker_vm.py b/gns3server/modules/docker/docker_vm.py index 93d16e1b..efe7f631 100644 --- a/gns3server/modules/docker/docker_vm.py +++ b/gns3server/modules/docker/docker_vm.py @@ -95,7 +95,11 @@ class DockerVM(BaseVM): @start_command.setter def start_command(self, command): - self._start_command = command + command = command.strip() + if len(command) == 0: + self._start_command = None + else: + self._start_command = command @property def environment(self): diff --git a/tests/modules/docker/test_docker_vm.py b/tests/modules/docker/test_docker_vm.py index d7faf9f2..c049e572 100644 --- a/tests/modules/docker/test_docker_vm.py +++ b/tests/modules/docker/test_docker_vm.py @@ -60,6 +60,15 @@ def test_json(vm, project): } +def test_start_command(vm): + + vm.start_command = "hello" + assert vm.start_command == "hello" + vm.start_command = " " + assert vm.start_command is None + + + def test_create(loop, project, manager): response = {