mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
also handle salt://| escaping in fileclient
This commit is contained in:
parent
e0ab1e9d9d
commit
2c3f82bd92
1 changed files with 7 additions and 4 deletions
|
@ -359,15 +359,18 @@ class Client(object):
|
|||
if senv:
|
||||
saltenv = senv
|
||||
|
||||
escape = '|' if path.startswith('|') else ''
|
||||
|
||||
# also strip escape character '|'
|
||||
localsfilesdest = os.path.join(
|
||||
self.opts['cachedir'], 'localfiles', path.lstrip('/'))
|
||||
self.opts['cachedir'], 'localfiles', path.lstrip('|/'))
|
||||
filesdest = os.path.join(
|
||||
self.opts['cachedir'], 'files', saltenv, path)
|
||||
self.opts['cachedir'], 'files', saltenv, path.lstrip('|'))
|
||||
|
||||
if os.path.exists(filesdest):
|
||||
return filesdest
|
||||
return u'{0}{1}'.format(escape, filesdest)
|
||||
elif os.path.exists(localsfilesdest):
|
||||
return localsfilesdest
|
||||
return u'{0}{1}'.format(escape, localsfilesdest)
|
||||
|
||||
return ''
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue