Commit Graph

1032 Commits

Author SHA1 Message Date
rallytime
776f2ea5d7
Merge branch '2018.3.0rc1' into '2018.3'
Conflicts:
  - salt/pillar/file_tree.py
  - tests/unit/modules/test_yumpkg.py
2018-02-26 11:01:42 -05:00
rallytime
69ac94baca
Update utils paths 2018-02-24 06:55:09 -05:00
rallytime
79bed6cff1
Merge branch '2017.7' into '2018.3'
Conflicts:
  - salt/modules/cmdmod.py
  - salt/modules/reg.py
  - salt/modules/win_lgpo.py
  - salt/modules/win_path.py
  - salt/modules/win_pkg.py
  - salt/pillar/file_tree.py
  - salt/states/boto3_route53.py
  - salt/states/reg.py
  - salt/utils/win_functions.py
  - tests/unit/modules/test_kubernetes.py
  - tests/unit/modules/test_win_path.py
2018-02-23 09:50:19 -05:00
Nicole Thomas
772636f67a
Merge pull request #46084 from garethgreenaway/oxygen_swap_to_datetime_objects
[oxygen] swap scheduler to use datetime objects
2018-02-20 17:51:26 -05:00
Gareth J. Greenaway
d37ac991a6
Fixing lint, unused imports 2018-02-20 10:01:19 -08:00
Gareth J. Greenaway
2559815eb5
Adding tests for after and until. Updating schedule unit tests. Adding skip_reason and friends for those two cases. Moving them to the end for evaluation. 2018-02-20 10:01:19 -08:00
rallytime
2d0f81fd1b
Merge branch 'oxygen.rc1' into 'oxygen'
No conflicts.
2018-02-16 12:36:13 -05:00
Erik Johnson
e9ddce6e26
Update unit tests to test new unicode normalization support 2018-02-15 20:27:44 -06:00
Nicole Thomas
edcb64de76
Merge pull request #45763 from twangboy/win_fix_path_rehash
Fix rehash function in win_path.py
2018-02-15 15:05:15 -05:00
rallytime
e060a74fd8
Merge branch '2017.7' into 'oxygen'
Conflicts:
  - salt/cloud/clouds/dimensiondata.py
  - salt/config/__init__.py
  - salt/modules/yumpkg.py
  - salt/pillar/ec2_pillar.py
  - salt/utils/docker/__init__.py
  - salt/utils/vault.py
  - tests/integration/states/test_docker_container.py
  - tests/unit/modules/test_yumpkg.py
  - tests/unit/templates/test_jinja.py
  - tests/unit/utils/test_docker.py
2018-02-14 16:31:31 -05:00
Nicole Thomas
3e18604d75
Merge pull request #45979 from isbm/isbm-parsers-loggerfix-unicode-rc1
Unicode/logger fix + bugfix: salt/utils/parsers
2018-02-14 10:39:24 -05:00
Nicole Thomas
e7999e260d
Merge pull request #44892 from terminalmage/yamlloader
Force Salt's YAML loader to load all strings as unicode types
2018-02-13 17:00:37 -05:00
rallytime
d6c2d0693a
Merge branch 'oxygen.rc1' into 'oxygen'
No conflicts.
2018-02-13 10:54:25 -05:00
Bo Maryniuk
8b5af58066 Fix lints 2018-02-12 18:54:23 +01:00
Bo Maryniuk
07ef909ea9 Remove unused variables, rename mixin variable to more exact name 2018-02-12 18:54:23 +01:00
Bo Maryniuk
9fa6647bd0 Refactor a unit test for calling PID file removal without the exception 2018-02-12 18:54:23 +01:00
Bo Maryniuk
fe4502b0e4 Add debug logging call to the unit test check 2018-02-12 18:54:23 +01:00
Bo Maryniuk
d9941ce1f3 Throw away unnecessary variable handling 2018-02-12 18:54:23 +01:00
Bo Maryniuk
56818045b6 Add unit test for calling PID deletion as non-root user 2018-02-12 18:54:23 +01:00
Bo Maryniuk
2f5b133149 Fix unit test to attempt remove PID file as root 2018-02-12 18:54:23 +01:00
Bo Maryniuk
3a8e43f806 Add tear-down method 2018-02-12 18:54:23 +01:00
Bo Maryniuk
7a0e3e983c Use pytest 2018-02-12 18:54:23 +01:00
Nicole Thomas
bc13ff8b48
Merge pull request #45941 from terminalmage/issue45679
Fix incorrect translation of docker port_bindings -> ports
2018-02-12 11:28:36 -05:00
Erik Johnson
89cbd72a0d
Don't try to sort ports when translating docker input
This sorting was done mainly for the benefit of the test suite, but
Python 3 will raise an error when you try to sort a mixture of int and
tuple types, so sorting breaks down when there are UDP ports.

Instead, this just leaves them as an unsorted list when passed to the
API, and the test suite does the sorting before the assertEqual.
2018-02-09 11:33:10 -06:00
Erik Johnson
29d0271b73
Don't try to sort ports when translating docker input
This sorting was done mainly for the benefit of the test suite, but
Python 3 will raise an error when you try to sort a mixture of int and
tuple types, so sorting breaks down when there are UDP ports.

Instead, this just leaves them as an unsorted list when passed to the
API, and the test suite does the sorting before the assertEqual.
2018-02-09 11:14:03 -06:00
Erik Johnson
9cd47b39dd
Fix incorrect translation of docker port_bindings -> ports
The logic which ensures that we expose ports which are being bound,
even when not explicitly configured, was done incorrectly. UDP ports
were being passed to the API as '1234/udp' instead of (1234, 'udp').
This results in the port not being exposed properly.

The logic has been corrected. Additionally both the "ports" input
translation function, as well as the post-processing code (where the
port numbers configured in port_bindings were being added) both
contained code to "fix" any ports which were configured using
'portnum/tcp', as these must be passed to the API simply as integers. To
reduce code duplication, this normalization is now only performed at the
very end of the post-processing function, after ports have been
translated, and any missing ports from the port_bindings have been
added.

The unit test for the port_bindings input translation code, which was
written based upon the same incorrect reading of the API docs that
resulted in the incorrect behavior, have been updated to confirm the
(now) correct behavior. The unit test for the ports input translation
code has been updated to reflect the new normalization behavior.

Finally, an integration test has been added to ensure that we properly
expose UDP ports which are added as part of the post-processing
function.
2018-02-08 23:23:43 -06:00
Erik Johnson
f35d9f6fef
Fix incorrect translation of docker port_bindings -> ports
The logic which ensures that we expose ports which are being bound,
even when not explicitly configured, was done incorrectly. UDP ports
were being passed to the API as '1234/udp' instead of (1234, 'udp').
This results in the port not being exposed properly.

The logic has been corrected. Additionally both the "ports" input
translation function, as well as the post-processing code (where the
port numbers configured in port_bindings were being added) both
contained code to "fix" any ports which were configured using
'portnum/tcp', as these must be passed to the API simply as integers. To
reduce code duplication, this normalization is now only performed at the
very end of the post-processing function, after ports have been
translated, and any missing ports from the port_bindings have been
added.

The unit test for the port_bindings input translation code, which was
written based upon the same incorrect reading of the API docs that
resulted in the incorrect behavior, have been updated to confirm the
(now) correct behavior. The unit test for the ports input translation
code has been updated to reflect the new normalization behavior.

Finally, an integration test has been added to ensure that we properly
expose UDP ports which are added as part of the post-processing
function.
2018-02-08 23:22:43 -06:00
twangboy
29912adc15
Move the test_rehash test to test_win_functions 2018-02-08 17:44:30 -07:00
Daniel Wallace
dc91055059
Revert "Separates key_dir from cache_dir, The key files (i.e. '.root_key', '.sudo_...') must not be shared with other masters."
This reverts commit 20bf4eed1d.

This change breaks publisher_acls.

1) The key_dir's permissions are controlled by `permissive_pki_access` which is
   not required by publisher_acls.  By default, it is also changed back to 700
   each time that the salt-master restarts, so it will have to be chmodded each
   time.
2) The default directory for these keys is changed, which will break a lot of
   users publisher_acls setups on an upgrade to Oxygen, and require them to go
   back in to chmod new directories.

I was going through and switching out the key dir to default back to
/var/cache/salt/master, and allow it to be changed, and also be able to specify
that it is a sensitive dir, but once I ran across the `permissive_pki_access`
stuff, I thought it was better to just revert this change and try again against
Fluorine, since we do not have a lot of tests in this area around publisher_acl.
2018-02-08 12:55:25 -07:00
rallytime
d80547e0b8
Merge branch '2017.7' into 'oxygen'
Conflicts:
  - salt/fileclient.py
  - salt/grains/disks.py
  - salt/modules/cmdmod.py
  - salt/state.py
  - salt/states/file.py
  - salt/utils/gitfs.py
  - salt/utils/win_functions.py
  - tests/integration/modules/test_state.py
  - tests/unit/cache/test_localfs.py
2018-02-08 11:23:31 -05:00
Erik Johnson
3f42a58363
Force Salt's YAML loader to load all strings as unicode types
This reduces the likelihood that non-unicode strings make their way into
Salt and cause str/unicode mismatches resulting in UnicodeDecodeErrors.
2018-02-08 09:04:49 -06:00
Erik Johnson
b4e24a69e6
Move get_context to salt.utils.stringutils
This avoids circular dependencies when salt.utils.jinja (which is
imported by salt.utils.templates) needs to use get_context()
2018-02-07 02:09:56 -06:00
Erik Johnson
f95139cae3
Add an option to silently keep data that fails to decode 2018-01-29 17:22:54 -06:00
Nicole Thomas
0fc2309cda
Merge branch 'oxygen' into win_fix_test_data 2018-01-29 13:24:03 -05:00
William Villeneuve
217791079b some code cleanup (lint errors and escape_argument as _cmd_quote) 2018-01-28 12:42:33 -05:00
Erik Johnson
c34a6f72cd
SSDP PY3 compatibility fixes 2018-01-28 11:09:20 -06:00
Erik Johnson
7115cd9d39
Don't import text_type directly so it doesn't get added to lazyloader 2018-01-27 14:50:16 -06:00
William Villeneuve
1c29bc5a3d fixed quoting of script path in cmd.script 2018-01-26 09:05:18 -05:00
Bo Maryniuk
fe99de3c0c Replace usage of str() forcing to unicode 2018-01-26 10:34:31 +01:00
Bo Maryniuk
f0c8839c1a Lintfix C0201: remove .keys() method 2018-01-26 10:34:31 +01:00
Bo Maryniuk
6144786fa8 Lintfix: W1699 (Python3 incompatibility) 2018-01-26 10:34:31 +01:00
Bo Maryniuk
ff89cd8527 Remove unused ImportError variable 2018-01-26 10:34:31 +01:00
Bo Maryniuk
f1b55e2ad0 Remove unused import 2018-01-26 10:34:31 +01:00
Bo Maryniuk
6ad6d11d97 Add unit test for timestamp error 2018-01-26 10:34:31 +01:00
Bo Maryniuk
50d3ce711e Add restriction check of log call when only general error happens 2018-01-26 10:34:31 +01:00
Bo Maryniuk
9a187bfb3a Add unit test for discovery general error handling 2018-01-26 10:34:31 +01:00
Bo Maryniuk
f700c3a870 Move helper class out of the test scope 2018-01-26 10:34:31 +01:00
Bo Maryniuk
89735d8599 Add unot test on no masters has been discovered 2018-01-26 10:34:31 +01:00
Bo Maryniuk
b4cc92e5af Rename unit test 2018-01-26 10:34:31 +01:00
Bo Maryniuk
11c8afb1f4 Update unit test for error handling 2018-01-26 10:34:31 +01:00