mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
always override global saltenv with url saltenv
This commit is contained in:
parent
db0f85a882
commit
e0ab1e9d9d
2 changed files with 10 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue