From 8db938c46d8f307d3ded8c2f42dea52488a58222 Mon Sep 17 00:00:00 2001 From: Jedrzej Nowak Date: Tue, 13 Oct 2015 18:58:23 +0200 Subject: [PATCH 1/2] Sync templates and scripts in shell handler --- solar/solar/core/handlers/shell.py | 1 + 1 file changed, 1 insertion(+) diff --git a/solar/solar/core/handlers/shell.py b/solar/solar/core/handlers/shell.py index f65780b7..31a225a2 100644 --- a/solar/solar/core/handlers/shell.py +++ b/solar/solar/core/handlers/shell.py @@ -25,6 +25,7 @@ class Shell(TempFileHandler): log.debug('action_file: %s', action_file) action_file_name = '/tmp/{}.sh'.format(resource.name) + self.prepare_templates_and_scripts(resource, action_name, '') self.transport_sync.copy(resource, action_file, action_file_name) self.transport_sync.sync_all() cmd = self.transport_run.run( From b9ea4bdd4ae9670b38653c0105af188d38c21866 Mon Sep 17 00:00:00 2001 From: Jedrzej Nowak Date: Tue, 13 Oct 2015 19:22:51 +0200 Subject: [PATCH 2/2] Sync in temp dirs --- solar/solar/core/handlers/shell.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/solar/solar/core/handlers/shell.py b/solar/solar/core/handlers/shell.py index 31a225a2..69a43a0a 100644 --- a/solar/solar/core/handlers/shell.py +++ b/solar/solar/core/handlers/shell.py @@ -15,6 +15,7 @@ from solar.core.log import log from solar import errors +import os from solar.core.handlers.base import TempFileHandler @@ -24,10 +25,12 @@ class Shell(TempFileHandler): action_file = self._compile_action_file(resource, action_name) log.debug('action_file: %s', action_file) - action_file_name = '/tmp/{}.sh'.format(resource.name) - self.prepare_templates_and_scripts(resource, action_name, '') - self.transport_sync.copy(resource, action_file, action_file_name) + action_file_name = os.path.join(self.dirs[resource.name], action_file) + self._copy_templates_and_scripts(resource, action_name) + + self.transport_sync.copy(resource, self.dst, '/tmp') self.transport_sync.sync_all() + cmd = self.transport_run.run( resource, 'bash', action_file_name,