Commit Graph

90436 Commits

Author SHA1 Message Date
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
480009a829
Pass unicode path to reg.set_value 2018-02-01 10:54:09 -06:00
Erik Johnson
829400f939
Add comment to explain PATH handling
Also use salt.utils.path.join()
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
8cacaab5c6
salt.utils.path.join: Only decode when needed
This prevents a traceback when one of the paths is already unicode
2018-02-01 10:30:12 -06:00
Erik Johnson
1787d38622
Remove unused import 2018-02-01 10:30:12 -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
Dmitry Kuzmenko
0b7fb33b03
Fixed lint errors 2018-01-31 19:15:46 +03: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
Dmitry Kuzmenko
c64ad435e7
Fixed raet master and minion shutdown 2018-01-31 17:40:24 +03:00
Dmitry Kuzmenko
0fa6e89024
Python3 RAET fixes. 2018-01-31 17:40:24 +03:00
Dmitry Kuzmenko
16136d4b02
Fixed RAET tests 2018-01-31 17:40:24 +03:00
Bo Maryniuk
d2dcf9986e Add unit test for dbus locale parser matching the results. 2018-01-31 15:36:51 +01:00
Nicole Thomas
5c3ede4022
Merge pull request #45791 from terminalmage/highstate-changes-colors
Restore colors to the changes for the highstate outputter
2018-01-31 09:33:56 -05:00
Nicole Thomas
3f17319af5
Merge pull request #45789 from garethgreenaway/650_salt-cloud_ec2_failures
[oxygen] Bumping up the timeout for integration.cloud.providers.test_ec2 tests
2018-01-31 09:30:13 -05:00
Nicole Thomas
3cad6affbb
Lint: Add extra blank line 2018-01-31 09:29:33 -05:00
Bo Maryniuk
2ac2004a95 Lintfix: continuation 2018-01-31 14:46:36 +01:00
Bo Maryniuk
a7dfe7dcae Remove extra-parenthesis 2018-01-31 14:46:23 +01:00
Bo Maryniuk
afdeca59f3 Fix a docstring 2018-01-31 14:46:07 +01:00
Bo Maryniuk
6aa2122a87 Move dbus's data to unicode 2018-01-31 14:45:49 +01: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
Bo Maryniuk
ea0b2e171f Lintfix: E8302, PEP8 expected two blank lines 2018-01-31 10:17:04 +01:00
Erik Johnson
73dbb9428e
Restore colors to the changes for the highstate outputter
Also, remove usage of salt.utils.locales.sdecode in favor of the
functions we have in salt.utils.data/stringutils to handle decoding to
unicode.

In October 2013, when the highstate outputter was changed to display the
changes using the nested outputter, it was configured to force all
output in the changes to be cyan. This was done by temporarily setting
__opts__['color'] to 'CYAN', so that when the nested outputter grabs the
color theme, it forces all output in the nested outputter to be cyan.
However, along the way, a couple unrelated changes caused this logic to
break down, making the nested outputter use its default color theme
(green for strings, yellow for integers/bools, etc. Firstly, the code
that retrieves the color theme (`salt.utils.color.get_color_theme()`)
was doing a type check on the the `use` parameter, only forccing the use
of the passed color name when it was a `str` type, and secondly the
value the nested outputter passed became a `unicode` type, causing it to
fail the type check (and thus ignoring the passed value).

Through our efforts to improve unicode compatibility, the type check in
`salt.utils.color.get_color_theme()` was fixed, and the colors for
changes are now all cyan. However, the contrast of having the different
colors is actually much more readable, so this commit has removed the
`__opts__` monkeypatching, which lets the nested outputter use its
default colors when displaying changes.
2018-01-30 20:09:08 -06:00
Gareth J. Greenaway
59fc7fcb34
Bumping up the timeout for integration.cloud.providers.test_ec2 tests. 2018-01-30 15:01:36 -08:00
Bo Maryniuk
13087b2062 Fix unit test: capture log message and redirect it to the test assertion 2018-01-30 21:14:04 +01:00
Bo Maryniuk
8a9dacc30b Fix unit tests for HAS_DBUS removal 2018-01-30 21:05:00 +01:00
Bo Maryniuk
4e3d98db1f Remove useless parallel variables 2018-01-30 21:01:50 +01:00
Bo Maryniuk
56f5645a09 Add unit test for localectl on arbitrary structure parser 2018-01-30 20:59:23 +01:00
Bo Maryniuk
5af33fbb0d Add unit test for localectl output parse on broken content 2018-01-30 20:51:23 +01:00
Nicole Thomas
42467ed2f9
Merge pull request #45778 from DSRCorporation/bugs/jenkins-813_missing_minion_test_fail
Support comma separated minion list target in payload for TCP transport
2018-01-30 14:49:52 -05:00
Bo Maryniuk
bcd04fa0ab Add log call verification 2018-01-30 20:47:26 +01:00
Bo Maryniuk
4f39075883 Add unit test for calling localectl parser on an empty output 2018-01-30 20:47:04 +01:00
Bo Maryniuk
a5d3098e9e Add unit test for localectl output status parser when no systemd installed 2018-01-30 20:38:33 +01:00
Bo Maryniuk
b4b0ea7d58 Add unit test for localectl output status parser 2018-01-30 20:36:17 +01:00
Nicole Thomas
8547a1cf8a
Merge pull request #45771 from rallytime/implement-42476
Add a central function to check for boto lib requirements
2018-01-30 13:24:49 -05:00
Nicole Thomas
e90358688b
Merge pull request #45766 from rallytime/45755-oxygen
Move #45755 to oxygen
2018-01-30 13:23:58 -05:00
Bo Maryniuk
ec4ef24cd3 Add unit test for set_locale on unknown system 2018-01-30 19:16:15 +01:00