From c130bdf5341769539bfa0daa15de80e34fb94413 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 10 Jan 2014 00:41:17 +0100 Subject: [PATCH 1/2] if hostname is an absolute path, strip alway leading slash Signed-off-by: Nico Schottelius --- cdist/exec/local.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cdist/exec/local.py b/cdist/exec/local.py index 72c7e70f..4233b874 100644 --- a/cdist/exec/local.py +++ b/cdist/exec/local.py @@ -194,7 +194,12 @@ class Local(object): return self.run(command=command, env=env, return_output=return_output, message_prefix=message_prefix) def save_cache(self): - destination = os.path.join(self.cache_path, self.target_host) + if os.path.isabs(self.target_host): + hostdir = self.target_host[1:] + else: + hostdir = self.target_host + + destination = os.path.join(self.cache_path, hostdir) self.log.debug("Saving " + self.base_path + " to " + destination) try: From d9de8b1dda29f0408373acfbd15bc49f9579e225 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 10 Jan 2014 00:42:01 +0100 Subject: [PATCH 2/2] ++changes(3.0.1) Signed-off-by: Nico Schottelius --- docs/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog b/docs/changelog index 45cf35b7..f75bfa9a 100644 --- a/docs/changelog +++ b/docs/changelog @@ -6,6 +6,7 @@ Changelog 3.0.1: * Core: Copy only files, not directories (Steven Armstrong) + * Core: Allow hostnames to start with / * Type __line: Remove unecessary backslash escape * Type __directory: Add messaging support (Daniel Heule) * Type __directory: Do not generate code if mode is 0xxx ((Daniel Heule)