- `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.
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.
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.