Commit Graph

84282 Commits

Author SHA1 Message Date
Bo Maryniuk
67034139d9 Fix unit test: wrong error types in side effect 2017-12-04 15:51:56 +01:00
Bo Maryniuk
d9359bca13 Bugfix: unit test mistakenly expects pillar errors as a string, while it is a list 2017-12-04 15:51:56 +01:00
Bo Maryniuk
8c2bdc696b Bugfix: do not pull '_errors' from unchecked objects 2017-12-04 15:51:56 +01:00
Bo Maryniuk
d5e30999c7 Remove unused variable (no exception, within the try/finally block) 2017-12-04 15:51:56 +01:00
Bo Maryniuk
aad668d559 Fix and clarify docstring. 2017-12-04 15:51:56 +01:00
Bo Maryniuk
c2c47e4e71 Rename function from ambiguous name 2017-12-04 15:51:56 +01:00
Bo Maryniuk
265de8e61c Bugfix the logic according to the exact described purpose of the function. 2017-12-04 15:51:56 +01:00
Nicole Thomas
4643a112e7
Merge pull request #44788 from kris-anderson/example-yaml-of-influxdb-user-state
Example yaml of influxdb_user state
2017-12-04 09:28:45 -05:00
Kris Anderson
afd23d058c converted yaml example to use 2 spaces 2017-12-03 21:14:12 -08:00
Nicole Thomas
4ebac09f60
Merge pull request #44735 from gracinet/42713_backport_2017.7
Backported issue #42713 to 2017.7
2017-12-03 20:43:22 -05:00
Nicole Thomas
06ce7b7328
Merge pull request #44766 from twangboy/win_fix_test_process
Fix `unit.utils.test_process` for Windows
2017-12-02 08:15:52 -05:00
twangboy
a5737e8fc3
Fix lint errors 2017-12-01 16:45:18 -07:00
twangboy
be96de09cc
Fix pickling error by decorating 2017-12-01 16:45:18 -07:00
Thomas S Hatch
f8b8a8966d
Merge pull request #44716 from rallytime/bp-44605
Back-port #44605 to 2017.7
2017-12-01 16:12:23 -07:00
Thomas S Hatch
8ed6287762
Merge pull request #44781 from cloudflare/thorium-fix-41869
Correct the thorium runner
2017-12-01 15:55:51 -07:00
Nicole Thomas
52596be102
Merge pull request #44466 from twangboy/win_fix_test_disk
Fix `unit.modules.test_disk` for Windows
2017-12-01 17:31:41 -05:00
Kris Anderson
29e410c1ea added a code-block example of how the yaml should be formatted 2017-12-01 11:31:08 -08:00
twangboy
5615862f23
Fix some lint 2017-12-01 10:25:48 -07:00
twangboy
627d5ab0c9
Mock salt.utils.which
cmd.run return values are mocked
2017-12-01 10:25:48 -07:00
twangboy
e5a96fe00f
Skip test_fstype on Windows
no lsblk on Windows
2017-12-01 10:25:48 -07:00
Mircea Ulinic
83c73a69cb
Instance the Runner class instead of the RunnerClient as we're running on the Master 2017-12-01 15:50:07 +00:00
Nicole Thomas
b9ad4bba2d
Merge pull request #44719 from rallytime/bp-44667
Back-port #44667 to 2017.7
2017-12-01 10:20:48 -05:00
Nicole Thomas
d23192c492
Merge pull request #44747 from gtmanfred/roster_defaults
use a copy so roster_defaults doesn't mangle
2017-12-01 10:13:47 -05:00
Nicole Thomas
20f20ad9e1
Merge pull request #44717 from garethgreenaway/44694_at_absent_failing_to_find_jobs
[2017.7] Fixes to at module
2017-12-01 09:37:05 -05:00
Nicole Thomas
6e61aa787f
Merge pull request #44695 from gtmanfred/pop
pop None for runas and runas_password
2017-12-01 09:35:00 -05:00
Mircea Ulinic
b72b7c5402
Correct the thorium runner
The thorium system is currently unable to invoke any runner (at all).
This is due to the fact that we go thorough the State system
which builds the "chunks" from the state-formatted data:
https://github.com/saltstack/salt/blob/develop/salt/thorium/__init__.py#L166

For example, the following Thorium state:

dummy:
  runner.cmd
    - fun: test.sleep
    - kwargs:
       s_time: 1

Will produce the following state chunks:

[{'name': 'dummy', 'state': 'runner', '__id__': 'dummy', 'kwargs': OrderedDict([('s_time', 1)]), 'fun': 'cmd', '__env__': 'base', '__sls__': u'dummy', 'order': 10000}]

The value of the `fun` field from the state chunks will override
the value specified in the Thorisum state. For the example above,
instead of execution the `test.sleep` runner function, it will
try instead to execute the `cmd` runner function, which will,
of course, fail.
In order to preserve the value of the actual function requested by
the user, we must rename `fun` to `func` to avoid this collision,
which is also in-line with the equivalent `local.cmd` for local
functions: https://github.com/saltstack/salt/blob/develop/salt/thorium/local.py#L14
The state chunks in this case will be:

[{'name': 'dummy', 'state': 'runner', '__id__': 'dummy', 'func': 'test.sleep', 'kwargs': OrderedDict([('s_time', 1)]), 'fun': 'cmd', '__env__': 'base', '__sls__': u'dummy', 'order': 10000}]

Which will correctly try to execute the requested runner function.
2017-12-01 14:12:23 +00:00
Gareth J. Greenaway
1f2b3c5f46
Merge branch '2017.7' into 44694_at_absent_failing_to_find_jobs 2017-11-30 16:31:57 -08:00
Mike Place
0efb90b6f7
Merge branch '2017.7' into pop 2017-11-30 16:52:44 -07:00
Daniel Wallace
911411ed8f
add unit test 2017-11-30 13:48:30 -07:00
Mike Place
20391c54c0
Merge pull request #44725 from whytewolf/1919_cmd.run_no_daemons
document note suggesting systemd-run --scope with cmd.run_bg
2017-11-30 12:18:05 -07:00
Nicole Thomas
85451ae977
Merge pull request #44760 from cloudflare/px-grains-set-42300
Fix the grains.setvals execution function when working with proxy minions
2017-11-30 13:27:02 -05:00
Gareth J. Greenaway
3bb385b44e
removing debugging logging 2017-11-30 10:16:12 -08:00
Nicole Thomas
06fb80b69c
Merge pull request #44640 from vutny/fix-cron-schedule-splay
Fix #44583: splay with cron-like scheduled jobs
2017-11-30 10:30:40 -05:00
Nicole Thomas
e5a1401b82
Merge pull request #44712 from Ch3LL/ssh_pillar_items
Add pillar ssh integration tests
2017-11-30 10:29:32 -05:00
Nicole Thomas
2e1c946990
Merge pull request #44763 from cloudflare/thorium-doc
Just a small improvement to the Thorium documentation
2017-11-30 09:38:03 -05:00
Nicole Thomas
8ba2df1ea0
Merge pull request #44531 from cloudflare/deprecate-napalm-tpl
Add deprecation notes for the NAPALM native templates
2017-11-30 09:18:55 -05:00
Mircea Ulinic
f8d69dd0ba
Add thorium_roots configuration example 2017-11-30 12:50:29 +00:00
Mircea Ulinic
4610fb4e62
thorium_roots not thorium_roots_dir 2017-11-30 12:48:17 +00:00
Denys Havrysh
d1f247e49e
Add basic unit tests for schedule util eval func 2017-11-30 12:43:52 +02:00
Denys Havrysh
6ff8e75ac6
Fix #44583: splay with cron-like scheduled jobs
Try to add "splay" time only if next job fire time is
still in the future for cron and other type of schedules.
2017-11-30 12:43:51 +02:00
Mircea Ulinic
655139d01c
Different path to the static grains file when running under a proxy minion
Similarly to the changes from #44549, we need to look under in a different
location when saving the static grains, so the grain file is, e.g.,
/etc/salt/proxy.d/{id}/grains.
This solves #42300.
2017-11-30 10:34:27 +00:00
Mircea Ulinic
3eec8dbc63
Dummy proxy: catch EOFError instead of IOError
This is due to the changes from #44551, when the dummy proxy module
is using salt.utils.files.mkstemp.
2017-11-30 10:31:04 +00:00
Gareth J. Greenaway
7f0ff5a8b0
When passing IDs on the command line convert them all the strings for later comparision. 2017-11-29 14:18:33 -08:00
Nicole Thomas
7bde48282e
Merge pull request #44737 from twangboy/win_skip_test_ipc
Skip `unit.transport.test_ipc` for Windows
2017-11-29 14:18:20 -05:00
Nicole Thomas
c5206113ce
Merge pull request #44629 from Ch3LL/high_masterless
Add masterless state.highstate integration test
2017-11-29 14:05:22 -05:00
Daniel Wallace
eefcfc719c
use a copy so roster_defaults doesn't mangle
The minion information is getting mangled if the roster_defaults is set
2017-11-29 11:46:08 -07:00
Georges Racinet
6806d83314
Merge branch '2017.7' into 42713_backport_2017.7 2017-11-29 19:00:38 +01:00
twangboy
4e0359b603
Skip IPC transport tests in Windows, not supported 2017-11-29 09:19:51 -07:00
Georges Racinet
fb586c6dce
Backported issue #42713 to 2017.7
Cherry-picked and squashed the two commits from the develop branch
(details at the end of this message)

The unit test module didn't exist at all on 2017.7, hence a conflict during
cherry picking, resolved by introducing only the new tests (the other ones
don't pass as is on 2017.7)

Also, the mock in unit tests for mine.get had to be adapted,
because the return of salt.utils.minions.CkMinions._check_compound_minions()
takes a different form on 2017.7 (just the list of minions).

Original cherry-picked commits:

commit 115ebef6a089dedf8dbadd3b4cca768adbb4a710
Author: Georges Racinet <gracinet@anybox.fr>
Date:   Wed Nov 8 18:02:29 2017 +0100

    Unit test for backwards compatibility of mine.get

    Could not find calls to RemoteFuncs in unit tests, therefore started a
    new one, hope it's in the appropriate place.

    The test replaces the caceh by its own (very limited) one. It's quite
    possible it could be improved by reusing another one meant for unit tests.

commit dc884478399355f3fbea8626a8366b933580dee0
Author: Georges Racinet <gracinet@anybox.fr>
Date:   Mon Oct 30 13:49:13 2017 +0100

    Backwards compat for mine.get on pre-Nitrogen minions

    With this change, the master will accept `expr_form` from
    its minions doing a `mine.get`, which is what minions versions
    before Nitrogen would do. This solves issue #42713.

    In case both `tgt_type` and `expr_form` are present, the former
    gets precedence.

    Performance-wise, this adds a single dict lookup for minions
    running Nitrogen onwards, and two for pre-Nitrogen minions.
    This is, in my opinion, acceptable.
2017-11-29 16:17:52 +01:00
Ch3LL
9b7421b261
Change check to the state id 2017-11-29 10:15:56 -05:00