fixed error in adding arguments
@@ -633,20 +633,23 @@ class Scheduler(object):
args = self._process_scripts[schedule.process_name]
# add core management host and port to process script args
- name = schedule.process_name.lower().replace(" ", "-")
- args.append("--name={}".format(name))
- args.append("--address={}".format(self._core_management_host))
- args.append("--port={}".format(str(self._core_management_port)))
+ args_to_exec = args.copy()
+ args_to_exec.append("--port")
+ args_to_exec.append(str(self._core_management_port))
+ args_to_exec.append("--address")
+ args_to_exec.append("127.0.0.1")
+ args_to_exec.append("--name")
+ args_to_exec.append(schedule.process_name.lower().replace(" ", "-"))
task_process = self._TaskProcess()
task_process.start_time = time.time()
try:
- process = await asyncio.create_subprocess_exec(*args)
+ process = await asyncio.create_subprocess_exec(*args_to_exec)
except EnvironmentError:
self._logger.exception(
"Unable to start schedule '%s' process '%s'\n%s".format(
- schedule.name, schedule.process_name, args))
+ schedule.name, schedule.process_name, args_to_exec))
raise
task_id = uuid.uuid4()
@@ -660,7 +663,7 @@ class Scheduler(object):
self._logger.info(
"Process started: Schedule '%s' process '%s' task %s pid %s, %s running tasks\n%s",
schedule.name, schedule.process_name, task_id, process.pid,
- len(self._task_processes), args)
+ len(self._task_processes), args_to_exec)
# Startup tasks are not tracked in the tasks table
if schedule.type != Schedule.Type.STARTUP:
