Unified command execution in Docker containers.
Also adds a hotfix for a broken test execution based on
an issue with a used library: https://github.com/pytest-dev/pytest/issues/4770
Change-Id: I54aade1eda31cb2584641b95226fbf39d9d298f4
Signed-off-by: peusterm <manuel.peuster@uni-paderborn.de>
diff --git a/src/emuvim/api/openstack/compute.py b/src/emuvim/api/openstack/compute.py
index 4d6517e..d7e944b 100755
--- a/src/emuvim/api/openstack/compute.py
+++ b/src/emuvim/api/openstack/compute.py
@@ -491,18 +491,19 @@
port.assigned_container = c
# Start the real emulator command now as specified in the dockerfile
- # ENV SON_EMU_CMD
config = c.dcinfo.get("Config", dict())
env = config.get("Env", list())
for env_var in env:
- if "SON_EMU_CMD=" in env_var:
- cmd = str(env_var.split("=")[1])
- server.son_emu_command = cmd
+ var, cmd = map(str.strip, map(str, env_var.split('=', 1)))
+ if var == "SON_EMU_CMD" or var == "VIM_EMU_CMD":
+ LOG.info("Executing script in '{}': {}={}"
+ .format(server.name, var, cmd))
# execute command in new thread to ensure that GK is not
# blocked by VNF
t = threading.Thread(target=c.cmdPrint, args=(cmd,))
t.daemon = True
t.start()
+ break # only execute one command
def stop_compute(self, server):
"""