From 15d6524efde25f89a217539ff8b2c3469b346cf0 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sun, 14 Aug 2016 22:09:51 +0200 Subject: [PATCH] Fix cdist shell. --- cdist/shell.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cdist/shell.py b/cdist/shell.py index ffbc310a..9378efc3 100644 --- a/cdist/shell.py +++ b/cdist/shell.py @@ -22,6 +22,7 @@ import logging import os import subprocess +import tempfile # initialise cdist import cdist.exec.local @@ -44,8 +45,14 @@ class Shell(object): "cdist-shell-no-target-host", ) + host_dir_name = cdist.str_hash(self.target_host[0]) + base_root_path = tempfile.mkdtemp() + host_base_path = os.path.join(base_root_path, host_dir_name) + self.local = cdist.exec.local.Local( - target_host=self.target_host) + target_host=self.target_host, + base_root_path=host_base_path, + host_dir_name=host_dir_name) def _init_shell(self): """Select shell to execute, if not specified by user"""