From dd1b95f5964528d3d8535c15bc8c4d3b7e5b87d2 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Fri, 19 Aug 2016 12:27:35 +0200 Subject: [PATCH 1/2] Add target_host file with original host to cache since cache dir is hash. --- cdist/exec/local.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cdist/exec/local.py b/cdist/exec/local.py index c6e25be3..50f0ab65 100644 --- a/cdist/exec/local.py +++ b/cdist/exec/local.py @@ -254,6 +254,10 @@ class Local(object): "Cannot delete old cache %s: %s" % (destination, e)) shutil.move(self.base_path, destination) + # add target_host since cache dir is hash-ed target_host + host_cache_path = os.path.join(destination, "target_host") + with open(host_cache_path, 'w') as hostf: + print(self.target_host[0], file=hostf) def _create_messages(self): """Create empty messages""" From b83e6993c1a4067c662fcaeb918de4acf6651e1d Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sun, 21 Aug 2016 17:10:24 +0200 Subject: [PATCH 2/2] Make comment better. --- cdist/exec/local.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdist/exec/local.py b/cdist/exec/local.py index 50f0ab65..93301063 100644 --- a/cdist/exec/local.py +++ b/cdist/exec/local.py @@ -254,7 +254,7 @@ class Local(object): "Cannot delete old cache %s: %s" % (destination, e)) shutil.move(self.base_path, destination) - # add target_host since cache dir is hash-ed target_host + # add target_host since cache dir can be hash-ed target_host host_cache_path = os.path.join(destination, "target_host") with open(host_cache_path, 'w') as hostf: print(self.target_host[0], file=hostf)