Skip to content

Commit

Permalink
Merge pull request #5021 from basepi/recurse5013
Browse files Browse the repository at this point in the history
Handle leading | in fileclient, Fix #5013
  • Loading branch information
thatch45 committed May 14, 2013
2 parents 70a8ce4 + 99ecd9f commit a745edf
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions salt/fileclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -410,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):
Expand Down

0 comments on commit a745edf

Please sign in to comment.