From 42042e0b6f0f515da59c9d277ac87455d98ce9cc Mon Sep 17 00:00:00 2001 From: Colton Myers Date: Tue, 14 May 2013 14:36:56 -0600 Subject: [PATCH 1/2] Fix some pep8 --- salt/fileclient.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/salt/fileclient.py b/salt/fileclient.py index f07092beeec7..90863626a348 100644 --- a/salt/fileclient.py +++ b/salt/fileclient.py @@ -157,11 +157,12 @@ def cache_dir(self, path, env='base', include_empty=False): if fn_.strip() and fn_.startswith(path)]) if include_empty: - # Break up the path into a list containing the bottom-level directory - # (the one being recursively copied) and the directories preceding it + # Break up the path into a list containing the bottom-level + # directory (the one being recursively copied) and the directories + # preceding it #separated = string.rsplit(path, '/', 1) #if len(separated) != 2: - # # No slashes in path. (This means all files in env will be copied) + # # No slashes in path. (So all files in env will be copied) # prefix = '' #else: # prefix = separated[0] From 99ecd9f587ebbb972f406794a702f35fbba43d4c Mon Sep 17 00:00:00 2001 From: Colton Myers Date: Tue, 14 May 2013 14:37:04 -0600 Subject: [PATCH 2/2] Handle leading | in fileclient, Fix #5013 --- salt/fileclient.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/salt/fileclient.py b/salt/fileclient.py index 90863626a348..15c5357b7980 100644 --- a/salt/fileclient.py +++ b/salt/fileclient.py @@ -411,6 +411,9 @@ def _find_file(self, path, env='base'): 'rel': ''} if env not in self.opts['file_roots']: return fnd + if path.startswith('|'): + # The path arguments are escaped + path = path[1:] for root in self.opts['file_roots'][env]: full = os.path.join(root, path) if os.path.isfile(full):