always override global saltenv with url saltenv

This commit is contained in:
Justin Findlay 2015-05-04 02:20:46 -06:00
parent db0f85a882
commit e0ab1e9d9d
2 changed files with 10 additions and 0 deletions

View file

@ -356,6 +356,8 @@ class Client(object):
if path.startswith('salt://'):
path, senv = salt.utils.url.parse(path)
if senv:
saltenv = senv
localsfilesdest = os.path.join(
self.opts['cachedir'], 'localfiles', path.lstrip('/'))
@ -953,6 +955,10 @@ class RemoteClient(Client):
cache
'''
path, senv = salt.utils.url.split_env(path)
if senv:
saltenv = senv
# Check if file exists on server, before creating files and
# directories
hash_server = self.hash_file(path, saltenv)

View file

@ -169,6 +169,10 @@ def get_file(path,
(path, dest) = _render_filenames(path, dest, saltenv, template)
path, senv = salt.utils.url.split_env(path)
if senv:
saltenv = senv
if not hash_file(path, saltenv):
return ''
else: