Commit Graph

12299 Commits

Author SHA1 Message Date
Nicole Thomas
d3a8f06911
Merge pull request #45927 from rallytime/utils-paths
Update old utils path to new path for which() function
2018-02-09 17:30:51 -05:00
Nicole Thomas
c0e01cea05
Merge pull request #45950 from rallytime/bp-45902
Back-port #45902 to oxygen.rc1
2018-02-09 17:30:17 -05:00
Nicole Thomas
570bbc9cd7
Merge pull request #45931 from gtmanfred/publisher
Fix publisher_acl for oxygen
2018-02-09 15:52:49 -05:00
Erik Johnson
0ff41c5835
Add regression test for issue 45893 2018-02-09 11:40:22 -05:00
rallytime
e04e7bdfc9
Remove extra patch 2018-02-09 09:40:22 -05:00
Nicole Thomas
f4acb18d4b
Merge pull request #45912 from gtmanfred/vmware
add test to verify vmware clusters can be used in vmware cloud
2018-02-09 07:15:51 -05: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
a16ea53430
Update old utils path to new path for which() function 2018-02-08 14:38:25 -05:00
Daniel Wallace
3e093ba022
fix pylint 2018-02-08 09:37:11 -07:00
Nicole Thomas
c88352a26f
Merge pull request #45844 from garethgreenaway/track_scheduled_next_time_skipped_jobs
[oxygen] Track the next scheduled fire time and when jobs are skipped.
2018-02-08 09:12:23 -05:00
Nicole Thomas
7e0cd38066
Merge pull request #45892 from terminalmage/issue45473
Add unit tests for gitfs features new to Oxygen
2018-02-08 08:50:10 -05:00
Daniel Wallace
56c5a333cd
add test to verify clusters
This test just double checks that the get_mor_containers is called twice when
trying to use a Cluster, and once if a datastore is specified.
2018-02-07 17:03:13 -07:00
Daniel Wallace
e892f75660
fix digital ocean tests 2018-02-07 14:04:37 -07:00
Erik Johnson
a0586748b6
Remove unused imports 2018-02-07 14:44:15 -06:00
Gareth J. Greenaway
09d960c0cb
Updating utils/schedule.py to be able to track when jobs are skipped because of the max_running parameter. This change moves that check out of handle_func and moves it to it's own function. Also updated skip tests to include a test that _skip_reason is included in the results when a job is skipped. 2018-02-07 11:39:10 -08:00
Gareth J. Greenaway
b23e5a7db2
Updating utils/schedule.py to be able to track when jobs are skipped because of the max_running parameter. This change moves that check out of handle_func and moves it to it's own function. Also updated skip tests to include a test that _skip_reason is included in the results when a job is skipped. 2018-02-07 11:39:09 -08:00
Nicole Thomas
a309933104
Merge pull request #45885 from terminalmage/issue45845
Catch and report YAML errors in jinja load_yaml
2018-02-07 14:08:48 -05:00
Erik Johnson
fb05654b71
Add unit tests for new Oxygen gitfs features
Also expand unit tests to test both GitPython and pygit2
2018-02-07 12:00:44 -06:00
Erik Johnson
a0f7eec7e5
Work around upstream pygit2 bug affecting unicode refs
This adds a workaround for a bug fixed upstream on 2 Feb 2018, which
caused a branch or tag containing a unicode character to raise a
UnicodeDecodeError. Additionally, it changes how we handle version
analysis in salt.utils.gitfs. We should be using the LooseVersion from
salt.utils.versions instead of distutils.version.
2018-02-07 12:00:44 -06:00
Nicole Thomas
ec590aff87
Merge pull request #45834 from terminalmage/cmdmod-unicode-compat
2 unicode-compatibility fixes for cmdmod.py
2018-02-07 09:51:14 -05: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
22c676ce57
Add option to cmdmod funcs to specify the output encoding 2018-02-07 02:01:55 -06:00
Erik Johnson
6cef37f310
2 unicode-compatibility fixes for cmdmod.py
First, `shlex.split()` will raise an exception when passed a unicode
type with unicode characters in the string. This modifies our
`shlex.split()` helper to first convert the passed string to a `str`
type, and then return a decoded copy of the result of the split.

Second, this uses our `to_unicode` helper to more gracefully decode the
stdout and stderr from the command. Unit tests have been added to
confirm that the output is properly decoded, including instances where
decoding fails because the return from the command contains binary data.
2018-02-07 02:01:55 -06:00
Daniel Wallace
57ab20308e
fix msazure cloud test 2018-02-06 14:50:20 -07:00
Daniel Wallace
f88ff75c19
fix gce tests 2018-02-06 13:27:11 -07:00
Nicole Thomas
becfb56ed0
Merge pull request #45786 from isbm/isbm-localectl-use
Multiple bugfixes for localemod
2018-02-02 09:09:22 -05:00
Nicole Thomas
543ef6d8a4
Merge pull request #45703 from terminalmage/path
Improve/remove PATH environment modifications
2018-02-01 16:07:16 -05:00
Nicole Thomas
7d5cf806f9
Merge pull request #45772 from terminalmage/decode-all-the-things
Decode payloads on Python 2 to preserve unicode in jobs and fileclient reqs
2018-02-01 16:06:50 -05:00
Erik Johnson
01194d6cdd
Update syslog_ng tests to reflect change in PATH behavior 2018-02-01 10:54:09 -06:00
Erik Johnson
1b78e49e1c
win_path: Do not normalize path to lowercase
This removes the lowercase normalization and handles case-insensitive
path matches. It also combines local path and system path inspection
into a single helper function in both add() and remove(), for simplicity.

Additionally, the add/remove unit tests have been rewritten to test
a wider array of use cases.
2018-02-01 10:54:09 -06:00
Erik Johnson
1b5c45a1fd
Add support for negative indexes 2018-02-01 10:54:09 -06:00
Erik Johnson
52ebc31f3d
Add comment regarding PATH handling 2018-02-01 10:54:09 -06:00
Erik Johnson
19d75b8eb9
Improve/remove PATH environment modifications
- `salt/modules/rbenv.py`: Forces use of str types in the custom env dict
  passed to `cmd.run_all`.
- `salt/modules/syslog_ng.py`: Ditches janky PATH munging in favor of
  the stable and long-existing support built into cmdmod.py
- `salt/modules/win_path.py`: Forces use of str types in path
  modification functions.
- `salt/states/win_path.py`: Completely rewritten. Duplicated code from
  the execution module removed in favor of calls to the execution
  module. Tests junked and 14 new tests written.
- `salt/utils/path.py`: The `which()` function was mistakenly modified
  in 20033ee to inject the directories in the POSIX default path into
  the PATH environment variable (even for Windows!). We never used the
  PATH to find the executables, we simply cycled through the dirs one by
  one and looked for an executable file matching the named path. The
  code that modifies the path is now removed. In addition, `which()` now
  uses `salt.utils.path.join()`, which gracefully handles mismatched
  str and unicode directory components to prevent decode errors.
  `join()` has also been simplified to use `salt.utils.data.decode()` to
  normalize directory components to unicode.
2018-02-01 10:54:09 -06:00
Erik Johnson
99de368afa
PY2: Fix system.set_computer_desc and set_computer_desc when desc is unicode
Both string_escape and unicode_escape don't like unicode content. This
scraps the escape encoding and simply does a series of string
replacements to disabmibguate quotes, newlines, and tab characters.
2018-02-01 10:30:12 -06:00
Erik Johnson
e0f4f70569
Update test to reflect type change due to unicode_literals 2018-02-01 10:30:12 -06:00
Bo Maryniuk
9e86a7d5f6 Lintfix: E8303 -- too many empty lines 2018-02-01 12:58:15 +01:00
Bo Maryniuk
5af6f147e6 Add unit test on set_locale for error handling when update-locale is not installed 2018-01-31 15:55:34 +01:00
Bo Maryniuk
4131f2e964 Fix unit test (mock everything!) 2018-01-31 15:52:36 +01:00
Bo Maryniuk
222b929d92 Add unit test for dbus locale parser which does not matching the results. 2018-01-31 15:42:32 +01:00
Bo Maryniuk
d2dcf9986e Add unit test for dbus locale parser matching the results. 2018-01-31 15:36:51 +01:00
Nicole Thomas
3cad6affbb
Lint: Add extra blank line 2018-01-31 09:29:33 -05:00
Bo Maryniuk
9468f7d91e Flatten the code 2018-01-31 13:28:07 +01:00
Bo Maryniuk
eeb08405f4 Remove old-style camel assertion in favour of PyTest built-in assertions 2018-01-31 13:24:47 +01:00
Bo Maryniuk
ec77e92dcf Move unit test test_avail to py.test 2018-01-31 13:20:46 +01:00
Bo Maryniuk
a4e44c40f9 Add unit test for gen_locale is handling error while calling not installed localedef on Suse os-family. 2018-01-31 13:17:53 +01:00
Bo Maryniuk
3d4e44e18c Add unit test gen_locale is calling localedef on Suse os-family. 2018-01-31 13:14:35 +01:00
Bo Maryniuk
16419ec6d3 Add check on gen_locale for Suse-specific path 2018-01-31 13:00:12 +01:00
Bo Maryniuk
58dde2ccbc Add unit test for gen_locale on Suse os_family with invalid locale 2018-01-31 12:54:42 +01:00
Bo Maryniuk
00f2695c79 Lintfix W1699: Python3 incompat 2018-01-31 10:19:04 +01:00
Bo Maryniuk
d423df4ded Lintfix E8301: expected 1 blank line 2018-01-31 10:17:44 +01:00