summaryrefslogtreecommitdiffstats
path: root/ms/command-executor/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'ms/command-executor/src/main')
-rw-r--r--ms/command-executor/src/main/python/command_executor_handler.py7
-rw-r--r--ms/command-executor/src/main/python/command_executor_server.py2
2 files changed, 8 insertions, 1 deletions
diff --git a/ms/command-executor/src/main/python/command_executor_handler.py b/ms/command-executor/src/main/python/command_executor_handler.py
index 365c00188..305c83e17 100644
--- a/ms/command-executor/src/main/python/command_executor_handler.py
+++ b/ms/command-executor/src/main/python/command_executor_handler.py
@@ -163,9 +163,16 @@ class CommandExecutorHandler():
def activate_venv(self):
self.logger.info("{} - Activate Python Virtual Environment".format(self.blueprint_id))
+ # Fix: The python generated activate_this.py script concatenates the env bin dir to PATH on every call
+ # eventually this process PATH variable was so big (128Kb) that no child process could be spawn
+ # This script will remove all duplicates; while keeping the order of the PATH folders
+ fixpathenvvar = "os.environ['PATH']=os.pathsep.join(list(dict.fromkeys(os.environ['PATH'].split(':'))))"
+
path = "%s/bin/activate_this.py" % self.venv_home
try:
exec (open(path).read(), {'__file__': path})
+ exec (fixpathenvvar)
+ self.logger.info("Running with PATH : {}".format(os.environ['PATH']))
return True
except Exception as err:
self.logger.info(
diff --git a/ms/command-executor/src/main/python/command_executor_server.py b/ms/command-executor/src/main/python/command_executor_server.py
index 3596a0ec5..6266141d9 100644
--- a/ms/command-executor/src/main/python/command_executor_server.py
+++ b/ms/command-executor/src/main/python/command_executor_server.py
@@ -53,5 +53,5 @@ class CommandExecutorServer(CommandExecutor_pb2_grpc.CommandExecutorServiceServi
if not handler.execute_command(request, results):
self.logger.info("{} - Failed to executeCommand. {}".format(blueprint_id, results))
return utils.build_response(request, results, False)
- self.logger.info("{} - Execute command logs: {}".format(blueprint_id, results))
+ self.logger.info("{} - Execution finished successfully.".format(blueprint_id))
return utils.build_response(request, results)