WORKDIR /son-emu
RUN python setup.py develop
+# Hotfix: https://github.com/pytest-dev/pytest/issues/4770
+RUN pip2 install "more-itertools<=5.0.0"
+
# Important: This entrypoint is required to start the OVS service
ENTRYPOINT ["/son-emu/utils/docker/entrypoint.sh"]
CMD ["python", "examples/default_single_dc_topology.py"]
'ipaddress',
'simplejson',
'gevent',
- 'flake8'
+ 'flake8',
+ # fixes: https://github.com/pytest-dev/pytest/issues/4770
+ 'more-itertools<=5.0.0'
],
zip_safe=False,
entry_points={
],
},
setup_requires=['pytest-runner'],
- tests_require=['pytest'],
+ tests_require=['pytest', 'more-itertools<=5.0.0'],
)
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):
"""
var, cmd = map(str.strip, map(str, env_var.split('=', 1)))
logging.debug("%r = %r" % (var, cmd))
if var == "SON_EMU_CMD" or var == "VIM_EMU_CMD":
- logging.info(
- "Executing entry point script in %r: %r" % (c.name, cmd))
+ logging.info("Executing script in '{}': {}={}"
+ .format(compute_name, var, cmd))
# execute command in new thread to ensure that API is
# not blocked by VNF
t = threading.Thread(target=c.cmdPrint, args=(cmd,))
env = config.get("Env", list())
for env_var in env:
var, cmd = map(str.strip, map(str, env_var.split('=', 1)))
- # LOG.debug("%r = %r" % (var, cmd))
if var == "SON_EMU_CMD" or var == "VIM_EMU_CMD":
LOG.info("Executing script in '{}': {}={}"
.format(vnfi.name, var, cmd))