From 3a80a2a714f97a90f53edb048b5b88e8fc8077ec Mon Sep 17 00:00:00 2001 From: Alexis de Talhouët Date: Fri, 6 Sep 2019 13:05:21 +0000 Subject: Revert "Use ProcessPool rather than ThreadPool Executor" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cd29a05ccd4279d7fb740d03bbeee6a0839b287e. Issue-ID: CCSDK-1681 Change-Id: I5827256ea5dc76b6ff8806250c684d155656dfc5 Signed-off-by: Alexis de Talhouët --- ms/command-executor/src/main/python/command_executor_handler.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'ms/command-executor/src/main/python/command_executor_handler.py') 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 abea4d411..972dad627 100644 --- a/ms/command-executor/src/main/python/command_executor_handler.py +++ b/ms/command-executor/src/main/python/command_executor_handler.py @@ -35,7 +35,6 @@ class CommandExecutorHandler(): self.request = request self.logger = logging.getLogger(self.__class__.__name__) self.blueprint_id = utils.get_blueprint_id(request) - # FIXME parameterize path self.venv_home = '/opt/app/onap/blueprints/deploy/' + self.blueprint_id self.installed = self.venv_home + '/.installed' @@ -61,6 +60,7 @@ class CommandExecutorHandler(): results.append(f.read()) f.close() + # deactivate_venv(blueprint_id) return True def execute_command(self, request, results): @@ -73,7 +73,6 @@ class CommandExecutorHandler(): if "ansible-playbook" in request.command: cmd = cmd + "; " + request.command + " -e 'ansible_python_interpreter=" + self.venv_home + "/bin/python'" else: - # we append the properties as last agr to the script cmd = cmd + "; " + request.command + " " + re.escape(MessageToJson(request.properties)) try: @@ -171,8 +170,8 @@ class CommandExecutorHandler(): path = "%s/bin/activate_this.py" % self.venv_home try: - exec(open(path).read(), {'__file__': path}) - exec(fixpathenvvar) + exec (open(path).read(), {'__file__': path}) + exec (fixpathenvvar) self.logger.info("Running with PATH : {}".format(os.environ['PATH'])) return True except Exception as err: -- cgit 1.2.3-korg