mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #39694 from rallytime/merge-2016.11
[2016.11] Merge forward from 2016.3 to 2016.11
This commit is contained in:
commit
00f121eade
@ -39,7 +39,15 @@ class SaltRun(parsers.SaltRunOptionParser):
|
||||
pr = activate_profile(profiling_enabled)
|
||||
try:
|
||||
ret = runner.run()
|
||||
if isinstance(ret, dict) and 'retcode' in ret.get('data', {}):
|
||||
# In older versions ret['data']['retcode'] was used
|
||||
# for signaling the return code. This has been
|
||||
# changed for the orchestrate runner, but external
|
||||
# runners might still use it. For this reason, we
|
||||
# also check ret['data']['retcode'] if
|
||||
# ret['retcode'] is not available.
|
||||
if isinstance(ret, dict) and 'retcode' in ret:
|
||||
self.exit(ret['retcode'])
|
||||
elif isinstance(ret, dict) and 'retcode' in ret.get('data', {}):
|
||||
self.exit(ret['data']['retcode'])
|
||||
finally:
|
||||
output_profile(
|
||||
|
@ -212,7 +212,7 @@ def setvals(grains, destructive=False, refresh=True):
|
||||
Defaults to False.
|
||||
|
||||
refresh
|
||||
Refresh minion grains using saltutil.sync_grains.
|
||||
Refresh modules and pillar after adding the new grains.
|
||||
Defaults to True.
|
||||
|
||||
CLI Example:
|
||||
@ -310,7 +310,7 @@ def setval(key, val, destructive=False, refresh=True):
|
||||
Defaults to False.
|
||||
|
||||
refresh
|
||||
Refresh minion grains using saltutil.sync_grains.
|
||||
Refresh modules and pillar after adding the new grain.
|
||||
Defaults to True.
|
||||
|
||||
CLI Example:
|
||||
|
@ -928,7 +928,7 @@ def disable(name, **kwargs): # pylint: disable=unused-argument
|
||||
return __salt__['cmd.retcode'](
|
||||
_systemctl_cmd('disable', name, systemd_scope=True),
|
||||
python_shell=False,
|
||||
ignore_recode=True) == 0
|
||||
ignore_retcode=True) == 0
|
||||
|
||||
|
||||
# The unused kwargs argument is required to maintain consistency with the API
|
||||
|
@ -66,9 +66,9 @@ def orchestrate(mods,
|
||||
ret = {'data': {minion.opts['id']: running}, 'outputter': 'highstate'}
|
||||
res = salt.utils.check_state_result(ret['data'])
|
||||
if res:
|
||||
ret['data']['retcode'] = 0
|
||||
ret['retcode'] = 0
|
||||
else:
|
||||
ret['data']['retcode'] = 1
|
||||
ret['retcode'] = 1
|
||||
return ret
|
||||
|
||||
# Aliases for orchestrate runner
|
||||
|
@ -845,7 +845,10 @@ def symlink(
|
||||
|
||||
mode
|
||||
The permissions to set on this file, aka 644, 0775, 4664. Not supported
|
||||
on Windows
|
||||
on Windows.
|
||||
|
||||
The default mode for new files and directories corresponds umask of salt
|
||||
process. For existing files and directories it's not enforced.
|
||||
'''
|
||||
name = os.path.expanduser(name)
|
||||
|
||||
@ -1305,7 +1308,10 @@ def managed(name,
|
||||
is running as on the minion On Windows, this is ignored
|
||||
|
||||
mode
|
||||
The mode to set on this file, e.g. ``644``, ``0775``, or ``4664``.
|
||||
The permissions to set on this file, e.g. ``644``, ``0775``, or ``4664``.
|
||||
|
||||
The default mode for new files and directories corresponds umask of salt
|
||||
process. For existing files and directories it's not enforced.
|
||||
|
||||
.. note::
|
||||
This option is **not** supported on Windows.
|
||||
@ -1340,6 +1346,9 @@ def managed(name,
|
||||
will be assigned permissions by adding the execute bit to the mode of
|
||||
the files.
|
||||
|
||||
The default mode for new files and directories corresponds umask of salt
|
||||
process. For existing files and directories it's not enforced.
|
||||
|
||||
replace : True
|
||||
If set to ``False`` and the file already exists, the file will not be
|
||||
modified even if changes would otherwise be made. Permissions and
|
||||
@ -2063,11 +2072,17 @@ def directory(name,
|
||||
|
||||
dir_mode / mode
|
||||
The permissions mode to set any directories created. Not supported on
|
||||
Windows
|
||||
Windows.
|
||||
|
||||
The default mode for new files and directories corresponds umask of salt
|
||||
process. For existing files and directories it's not enforced.
|
||||
|
||||
file_mode
|
||||
The permissions mode to set any files created if 'mode' is run in
|
||||
'recurse'. This defaults to dir_mode. Not supported on Windows
|
||||
'recurse'. This defaults to dir_mode. Not supported on Windows.
|
||||
|
||||
The default mode for new files and directories corresponds umask of salt
|
||||
process. For existing files and directories it's not enforced.
|
||||
|
||||
makedirs
|
||||
If the directory is located in a path without a parent directory, then
|
||||
@ -2419,14 +2434,19 @@ def recurse(name,
|
||||
salt is running as on the minion. On Windows, this is ignored
|
||||
|
||||
dir_mode
|
||||
The mode to set on any directories created.
|
||||
The permissions mode to set on any directories created.
|
||||
|
||||
The default mode for new files and directories corresponds umask of salt
|
||||
process. For existing files and directories it's not enforced.
|
||||
|
||||
.. note::
|
||||
This option is **not** supported on Windows.
|
||||
|
||||
file_mode
|
||||
The mode to set on any files created.
|
||||
Windows
|
||||
The permissions mode to set on any files created.
|
||||
|
||||
The default mode for new files and directories corresponds umask of salt
|
||||
process. For existing files and directories it's not enforced.
|
||||
|
||||
.. note::
|
||||
This option is **not** supported on Windows.
|
||||
@ -2440,7 +2460,10 @@ def recurse(name,
|
||||
incompatible with the ``contents`` options.
|
||||
|
||||
sym_mode
|
||||
The mode to set on any symlink created.
|
||||
The permissions mode to set on any symlink created.
|
||||
|
||||
The default mode for new files and directories corresponds umask of salt
|
||||
process. For existing files and directories it's not enforced.
|
||||
|
||||
.. note::
|
||||
This option is **not** supported on Windows.
|
||||
@ -4559,7 +4582,10 @@ def copy(
|
||||
|
||||
The permissions to set on the copied file, aka 644, '0775', '4664'.
|
||||
If ``preserve`` is set to ``True``, then this will be ignored.
|
||||
Not supported on Windows
|
||||
Not supported on Windows.
|
||||
|
||||
The default mode for new files and directories corresponds umask of salt
|
||||
process. For existing files and directories it's not enforced.
|
||||
|
||||
subdir
|
||||
.. versionadded:: 2015.5.0
|
||||
@ -4942,6 +4968,9 @@ def serialize(name,
|
||||
The permissions to set on this file, e.g. ``644``, ``0775``, or
|
||||
``4664``.
|
||||
|
||||
The default mode for new files and directories corresponds umask of salt
|
||||
process. For existing files and directories it's not enforced.
|
||||
|
||||
.. note::
|
||||
This option is **not** supported on Windows.
|
||||
|
||||
|
@ -514,6 +514,9 @@ class SystemdScopeTestCase(TestCase):
|
||||
def test_enable(self):
|
||||
self._change_state('enable')
|
||||
|
||||
def test_disable(self):
|
||||
self._change_state('disable')
|
||||
|
||||
def test_mask(self):
|
||||
self._mask_unmask('mask', False)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user