New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[oxygen] Merge forward from oxygen.rc1 to oxygen #45861
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Published functions are serialized when they go over the wire and deserialized on the far end. This causes unicode CLI args to be lost on Python 2. Similarly, fileclient requests made from the minion to a master using the RemoteClient will have the same issue. This commit does the following things to ensure we don't lose unicode from CLI args, and also to ensure that fileclient requests involving unicode are successful: 1. Decodes the return from the various "list" functions in the RemoteClient. 2. Decodes the payload received from by the fileserver from a minion. Also removes the decoding done in these same functions, because A) the backends already support unicode, and B) unicode characters will be re-encoded as part of the serialization process anyway. 3. Decodes the payload received by the minion so that the arguments passed to the function being called are unicode.
This prevents a traceback when one of the paths is already unicode
- `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.
Also use salt.utils.path.join()
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.
This prevents a traceback when salt is run in a container where /sys/block is not present.
…hings Decode payloads on Python 2 to preserve unicode in jobs and fileclient reqs
Improve/remove PATH environment modifications
…when the multiprocessing queue is full. This situation is happening when running the full testing suite on MacOS where the queue limit is 32767 vs on Linux where the queue limit is unlimited.
…ceback Fix traceback in disks grains when /sys/block not available
Multiple bugfixes for localemod
decode file list for setup.py on python2
This clears up some warnings when we build the docs, and improves the syntax highlighting in the docs.
locale.getpreferredencoding() may not be equal to it, and we don't use locale.getpreferredencoding() anyway when we perform unicode conversions in salt, we use __salt_system_encoding__.
Back-port saltstack#45764 to oxygen.rc1
Fix invalid Sphinx lexers in docs
Change "locale" value in versions-report to use __salt_system_encoding__
…ng_queue_full [oxygen] Catch exception when logging queue is full
No conflicts.
garethgreenaway
approved these changes
Feb 7, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No conflicts.