mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Update cp module salt-ssh wrapper to use new cachedir param
This commit is contained in:
parent
0320494b1d
commit
d9370a8041
1 changed files with 13 additions and 3 deletions
|
@ -7,6 +7,7 @@ from __future__ import absolute_import
|
|||
# Import salt libs
|
||||
import salt.client.ssh
|
||||
import logging
|
||||
import os
|
||||
from salt.exceptions import CommandExecutionError
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
@ -33,7 +34,10 @@ def get_file(path,
|
|||
if template is not None:
|
||||
(path, dest) = _render_filenames(path, dest, saltenv, template)
|
||||
|
||||
src = __context__['fileclient'].cache_file(path, saltenv)
|
||||
src = __context__['fileclient'].cache_file(
|
||||
path,
|
||||
saltenv,
|
||||
cachedir=os.path.join('salt-ssh', __salt__.kwargs['id_']))
|
||||
single = salt.client.ssh.Single(
|
||||
__opts__,
|
||||
'',
|
||||
|
@ -46,7 +50,10 @@ def get_dir(path, dest, saltenv='base'):
|
|||
'''
|
||||
Transfer a directory down
|
||||
'''
|
||||
src = __context__['fileclient'].cache_dir(path, saltenv)
|
||||
src = __context__['fileclient'].cache_dir(
|
||||
path,
|
||||
saltenv,
|
||||
cachedir=os.path.join('salt-ssh', __salt__.kwargs['id_']))
|
||||
src = ' '.join(src)
|
||||
single = salt.client.ssh.Single(
|
||||
__opts__,
|
||||
|
@ -60,7 +67,10 @@ def get_url(path, dest, saltenv='base'):
|
|||
'''
|
||||
retrive a URL
|
||||
'''
|
||||
src = __context__['fileclient'].get_url(path, saltenv)
|
||||
src = __context__['fileclient'].get_url(
|
||||
path,
|
||||
saltenv,
|
||||
cachedir=os.path.join('salt-ssh', __salt__.kwargs['id_']))
|
||||
single = salt.client.ssh.Single(
|
||||
__opts__,
|
||||
'',
|
||||
|
|
Loading…
Add table
Reference in a new issue