mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #23429 from basepi/merge-forward-2015.5
[2015.5] Merge forward from 2014.7 to 2015.5
This commit is contained in:
commit
3c4f734332
@ -218,7 +218,7 @@ Create the Build Environment
|
||||
Right-click on the file named **dev_env_salt.ps1** and select **Run with
|
||||
Powershell**
|
||||
|
||||
This will clone salt into ``C:\Salt-Dev\salt`` and set it to the 2015.2
|
||||
This will clone salt into ``C:\Salt-Dev\salt`` and set it to the 2015.5
|
||||
branch. You could optionally run the command from a powershell window with a
|
||||
``-Version`` switch to pull a different version. For example:
|
||||
|
||||
|
@ -129,7 +129,7 @@ configuration file named ``master``.
|
||||
Minion Config
|
||||
---------------
|
||||
|
||||
.. versionadded:: 2015.2.1
|
||||
.. versionadded:: 2015.5.1
|
||||
|
||||
Minion config options can be defined globally using the master configuration
|
||||
option ``ssh_minion_opts``. It can also be defined on a per-minion basis with
|
||||
|
@ -129,7 +129,7 @@ For APT-based distros such as Ubuntu and Debian:
|
||||
switching to a new :conf_master:`gitfs_provider`, but it is less important
|
||||
when switching between GitPython and pygit2.
|
||||
|
||||
Beginning in version 2015.2.0, the gitfs cache can be easily cleared using
|
||||
Beginning in version 2015.5.0, the gitfs cache can be easily cleared using
|
||||
the :mod:`fileserver.clear_cache <salt.runners.fileserver.clear_cache>`
|
||||
runner.
|
||||
|
||||
@ -183,7 +183,7 @@ master:
|
||||
.. note::
|
||||
|
||||
Dulwich does not recognize ``ssh://`` URLs, ``git+ssh://`` must be used
|
||||
instead. Salt version 2015.2.0 and later will automatically add the
|
||||
instead. Salt version 2015.5.0 and later will automatically add the
|
||||
``git+`` to the beginning of these URLs before fetching, but earlier
|
||||
Salt versions will fail to fetch unless the URL is specified using
|
||||
``git+ssh://``.
|
||||
|
@ -525,7 +525,7 @@ def __get_ssh_credentials(vm_):
|
||||
'ssh_username', vm_, __opts__, default=os.getenv('USER'))
|
||||
ssh_key = config.get_cloud_config_value(
|
||||
'ssh_keyfile', vm_, __opts__,
|
||||
default=os.getenv('HOME') + '/.ssh/google_compute_engine')
|
||||
default=os.path.expanduser('~/.ssh/google_compute_engine'))
|
||||
return ssh_user, ssh_key
|
||||
|
||||
|
||||
|
@ -274,7 +274,7 @@ def gen_locale(locale, **kwargs):
|
||||
if os.path.exists('/etc/locale.gen'):
|
||||
__salt__['file.replace'](
|
||||
'/etc/locale.gen',
|
||||
r'^#\s*{0}$'.format(locale),
|
||||
r'^\s*#\s*{0}\s*$'.format(locale),
|
||||
'{0}'.format(locale),
|
||||
append_if_not_found=True
|
||||
)
|
||||
|
@ -49,7 +49,7 @@ painful in windows.
|
||||
|
||||
To do this you just use pip with git to update to the version you want and then
|
||||
restart the service. Here is a sample state file that upgrades salt to the head
|
||||
of the 2015.2 branch:
|
||||
of the 2015.5 branch:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
@ -57,7 +57,7 @@ of the 2015.2 branch:
|
||||
pip.installed:
|
||||
- cwd: 'C:\salt\bin\scripts'
|
||||
- bin_env: 'C:\salt\bin\scripts\pip.exe'
|
||||
- editable: git+https://github.com/saltstack/salt@2015.2#egg=salt
|
||||
- editable: git+https://github.com/saltstack/salt@2015.5#egg=salt
|
||||
- upgrade: True
|
||||
|
||||
restart_service:
|
||||
|
@ -580,6 +580,7 @@ def hypermedia_in():
|
||||
if (cherrypy.request.method.upper() == 'POST'
|
||||
and cherrypy.request.headers.get('Content-Length', '0') == '0'):
|
||||
cherrypy.request.process_request_body = False
|
||||
cherrypy.request.unserialized_data = None
|
||||
|
||||
cherrypy.request.body.processors.clear()
|
||||
cherrypy.request.body.default_proc = cherrypy.HTTPError(
|
||||
|
@ -17,7 +17,7 @@ def envs(backend=None, sources=False, outputter=None):
|
||||
backend
|
||||
Narrow fileserver backends to a subset of the enabled ones.
|
||||
|
||||
.. versionchanged:: 2015.2.0::
|
||||
.. versionchanged:: 2015.5.0
|
||||
If all passed backends start with a minus sign (``-``), then these
|
||||
backends will be excluded from the enabled backends. However, if
|
||||
there is a mix of backends with and without a minus sign (ex:
|
||||
@ -66,7 +66,7 @@ def file_list(saltenv='base', backend=None, outputter=None):
|
||||
``backend=-roots,git``) then the ones starting with a minus sign will
|
||||
be disregarded.
|
||||
|
||||
.. versionadded:: 2015.2.0
|
||||
.. versionadded:: 2015.5.0
|
||||
|
||||
CLI Examples:
|
||||
|
||||
@ -109,7 +109,7 @@ def symlink_list(saltenv='base', backend=None, outputter=None):
|
||||
``backend=-roots,git``) then the ones starting with a minus sign will
|
||||
be disregarded.
|
||||
|
||||
.. versionadded:: 2015.2.0
|
||||
.. versionadded:: 2015.5.0
|
||||
|
||||
CLI Example:
|
||||
|
||||
@ -152,7 +152,7 @@ def dir_list(saltenv='base', backend=None, outputter=None):
|
||||
``backend=-roots,git``) then the ones starting with a minus sign will
|
||||
be disregarded.
|
||||
|
||||
.. versionadded:: 2015.2.0
|
||||
.. versionadded:: 2015.5.0
|
||||
|
||||
CLI Example:
|
||||
|
||||
@ -182,7 +182,7 @@ def dir_list(saltenv='base', backend=None, outputter=None):
|
||||
|
||||
def empty_dir_list(saltenv='base', backend=None, outputter=None):
|
||||
'''
|
||||
.. versionadded:: 2015.2.0
|
||||
.. versionadded:: 2015.5.0
|
||||
|
||||
Return a list of empty directories in the given environment
|
||||
|
||||
@ -236,7 +236,7 @@ def update(backend=None):
|
||||
backend
|
||||
Narrow fileserver backends to a subset of the enabled ones.
|
||||
|
||||
.. versionchanged:: 2015.2.0
|
||||
.. versionchanged:: 2015.5.0
|
||||
If all passed backends start with a minus sign (``-``), then these
|
||||
backends will be excluded from the enabled backends. However, if
|
||||
there is a mix of backends with and without a minus sign (ex:
|
||||
@ -261,7 +261,7 @@ def update(backend=None):
|
||||
|
||||
def clear_cache(backend=None):
|
||||
'''
|
||||
.. versionadded:: 2015.2.0
|
||||
.. versionadded:: 2015.5.0
|
||||
|
||||
Clear the fileserver cache from VCS fileserver backends (:mod:`git
|
||||
<salt.fileserver.gitfs>`, :mod:`hg <salt.fileserver.hgfs>`, :mod:`svn
|
||||
@ -299,7 +299,7 @@ def clear_cache(backend=None):
|
||||
|
||||
def clear_lock(backend=None, remote=None):
|
||||
'''
|
||||
.. versionadded:: 2015.2.0
|
||||
.. versionadded:: 2015.5.0
|
||||
|
||||
Clear the fileserver update lock from VCS fileserver backends (:mod:`git
|
||||
<salt.fileserver.gitfs>`, :mod:`hg <salt.fileserver.hgfs>`, :mod:`svn
|
||||
@ -340,7 +340,7 @@ def clear_lock(backend=None, remote=None):
|
||||
|
||||
def lock(backend=None, remote=None):
|
||||
'''
|
||||
.. versionadded:: 2015.2.0
|
||||
.. versionadded:: 2015.5.0
|
||||
|
||||
Set a fileserver update lock for VCS fileserver backends (:mod:`git
|
||||
<salt.fileserver.gitfs>`, :mod:`hg <salt.fileserver.hgfs>`, :mod:`svn
|
||||
|
@ -1069,7 +1069,14 @@ def deploy_script(host,
|
||||
)
|
||||
file_map_fail.append({local_file: remote_file})
|
||||
continue
|
||||
remote_dir = os.path.dirname(remote_file)
|
||||
|
||||
if os.path.isdir(local_file):
|
||||
dir_name = os.path.basename(local_file)
|
||||
remote_dir = os.path.join(os.path.dirname(remote_file),
|
||||
dir_name)
|
||||
else:
|
||||
remote_dir = os.path.dirname(remote_file)
|
||||
|
||||
if remote_dir not in remote_dirs:
|
||||
root_cmd('mkdir -p \'{0}\''.format(remote_dir), tty, sudo, **ssh_kwargs)
|
||||
remote_dirs.append(remote_dir)
|
||||
@ -1547,6 +1554,8 @@ def sftp_file(dest_path, contents=None, kwargs=None, local_file=None):
|
||||
'''
|
||||
Use sftp to upload a file to a server
|
||||
'''
|
||||
put_args = []
|
||||
|
||||
if kwargs is None:
|
||||
kwargs = {}
|
||||
|
||||
@ -1557,6 +1566,8 @@ def sftp_file(dest_path, contents=None, kwargs=None, local_file=None):
|
||||
|
||||
if local_file is not None:
|
||||
tmppath = local_file
|
||||
if os.path.isdir(local_file):
|
||||
put_args = ['-r']
|
||||
|
||||
log.debug('Uploading {0} to {1} (sfcp)'.format(dest_path, kwargs.get('hostname')))
|
||||
|
||||
@ -1615,8 +1626,8 @@ def sftp_file(dest_path, contents=None, kwargs=None, local_file=None):
|
||||
)
|
||||
)
|
||||
|
||||
cmd = 'echo "put {0} {1}" | sftp {2} {3[username]}@{3[hostname]}'.format(
|
||||
tmppath, dest_path, ' '.join(ssh_args), kwargs
|
||||
cmd = 'echo "put {0} {1} {2}" | sftp {3} {4[username]}@{4[hostname]}'.format(
|
||||
' '.join(put_args), tmppath, dest_path, ' '.join(ssh_args), kwargs
|
||||
)
|
||||
log.debug('SFTP command: {0!r}'.format(cmd))
|
||||
retcode = _exec_ssh_cmd(cmd,
|
||||
|
Loading…
Reference in New Issue
Block a user