From 9f231a9ce7a93a80eb0637f8a1ba4fdae669b5af Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Fri, 14 Oct 2011 09:47:59 +0200 Subject: [PATCH] suffix cache path with target_host Signed-off-by: Steven Armstrong --- lib/cdist/config_install.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/cdist/config_install.py b/lib/cdist/config_install.py index e4ac2dde..72ff7c6c 100644 --- a/lib/cdist/config_install.py +++ b/lib/cdist/config_install.py @@ -54,10 +54,11 @@ class ConfigInstall(object): def cleanup(self): # FIXME: move to local? - self.log.debug("Saving " + self.local.out_path + " to " + self.local.cache_path) - if os.path.exists(self.local.cache_path): - shutil.rmtree(self.local.cache_path) - shutil.move(self.local.out_path, self.local.cache_path) + destination = os.path.join(self.local.cache_path, self.context.target_host) + self.log.debug("Saving " + self.local.out_path + " to " + destination) + if os.path.exists(destination): + shutil.rmtree(destination) + shutil.move(self.local.out_path, destination) def deploy_to(self): """Mimic the old deploy to: Deploy to one host"""