Commit Graph

28 Commits

Author SHA1 Message Date
rallytime
3d2ea16c3a
Merge branch '2017.7' into '2018.3'
Conflicts:
  - requirements/base.txt
  - salt/states/archive.py
  - salt/states/file.py
  - tests/integration/runners/test_state.py
  - tests/unit/daemons/test_masterapi.py
2018-06-11 11:45:37 -04:00
Daniel Wallace
556a2067fc
fix masterapi test to use testing directory for configs 2018-06-05 18:36:27 -05:00
rallytime
fb4f2dd0fa
Distinguish between Authorization and Authentication errors
And handle the error distiction being returned from the publish function
instead of sending empty strings.
2018-01-23 17:05:22 -05:00
Nicole Thomas
56de7bcf5d
Merge pull request #45305 from terminalmage/py3-daemons
[PY3] Add unicode_literals to daemons modules
2018-01-09 16:30:36 -05:00
twangboy
df0958e699
Fix decorator, fix asserts for Windows 2018-01-08 14:53:18 -07:00
Erik Johnson
5b91c78cb6
[PY3] Add unicode_literals to daemons modules 2018-01-05 15:34:48 -06:00
Benedikt Werner
449535edbd
Fix masterapi AutoKey test 2017-12-05 18:18:27 +01: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
Benedikt Werner
6900e6ece1
Merge branch 'develop' into accept-minions-from-grains 2017-11-17 19:35:53 +01:00
Nicole Thomas
a5bb896ff1
Merge pull request #44340 from gracinet/42713_mine.get_back_compat
Backwards compat for mine.get on pre-Nitrogen minions
2017-11-13 16:49:51 -05:00
Georges Racinet
5c01c74fbc
Merge branch 'develop' of github.com:saltstack/salt into 42713_mine.get_back_compat
... and fixed conflict
2017-11-08 18:09:04 +01:00
Georges Racinet
728c9b65a5
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.
2017-11-08 18:02:29 +01:00
Benedikt Werner
4a63798e84
Fixed linting 2017-11-01 01:01:22 +01:00
Benedikt Werner
7bb85f417f
Merge branch 'develop' into develop 2017-10-31 23:15:03 +01:00
Benedikt Werner
82d6cb72f0
Merge branch 'develop' into accept-minions-from-grains 2017-10-31 13:55:11 +01:00
Benedikt Werner
4c5259da3a
Fix syntax error in unit test 2017-10-30 17:30:21 +01:00
Benedikt Werner
23d3c71a55
Fix unit test 2017-10-30 17:27:28 +01:00
Benedikt Werner
51ce80ce50
Fix style 2017-10-29 14:02:38 +01:00
Benedikt Werner
d06d031227
Moved autosign grains integration tests to its own file 2017-10-29 14:02:37 +01:00
Benedikt Werner
8f2693237c
Fixed and improved autoaccept grains docs 2017-10-29 14:02:36 +01:00
Benedikt Werner
46d0979b94
Fixed autosign grains unit test 2017-10-29 14:02:36 +01:00
Benedikt Werner
244b8c2049
Fix masterapi unit test 2017-10-29 14:02:18 +01:00
Benedikt Werner
2bd1ae6501
Added unit test for check_autosign_grains 2017-10-29 13:54:05 +01:00
Benedikt Werner
11920372b3
Moved patch function outside of class to fix linting 2017-10-20 14:21:45 +02:00
Benedikt Werner
295b5d4834
Added tests and doc 2017-10-20 06:02:08 +02:00
rallytime
74acaad46e
Refactor publish func in master/masterapi to use check_authentication
In a previous PR, the runner and wheel functions in master.py and masterapi.py
were refactored to reduce common code via the salt.auth.check_authentication
method.

The publish function also can utilize the check_authentication function in
master.py and masterapi.py.

Consolidation of this code will help us be able to differentiate between
authorization and authentication errors in the future.
2017-10-17 12:27:13 -04:00
rallytime
846af152b2
Update mocked values in some master/masterapi unit tests
The addition of checking for the `auth_list` in PR #43467 requires
that the mocked return of `get_auth_list` actually contains something
in the list. These mock calls need to be updated so we can check
for the SaltInvocationErrors.
2017-09-25 12:54:32 -04:00
rallytime
b93392dfb7 Return a SaltInvocationError when passing incorrect function pattern
When calling an incorrectly formatted wheel or runner function, we should
be raising a SaltInvocationError with a hint to check function syntax rather
that raising an Eauth authentication error.

This PR does several things:

- Adds a dictionary error return when the function syntax passed through to
`utils.minions.CkMinions.spec_check` does not match the expected `module.function`
syntax
- Handles the return of this new dictionary error (instead of previous `False` return)
wherever the spec_check function is called. This is handled up the stack in
`master.py` and `masterapi.py`.
- Reworks the runner and wheel functions in `master.py` and `masterapi.py` to
help make those functions more DRY (see `salt.auth.check_authentication` function).
- Adds tests for all of these changes (written before the runner and wheel functions
were moved to use the new salt.auth.check_authentication function)  to help prevent
regressions.
- Fixes a couple of places where unit tests exposed potential stacktraces.
- Adjusts one previous unit test concerning the dictionary error change from spec_check
2017-09-05 17:08:50 -04:00