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
Fix types when evaluating interpreter #36541
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
sivel
changed the title
Fix types when evaluating interpreter. Fixes #36536
Fix types when evaluating interpreter
Feb 21, 2018
nitzmahone
approved these changes
Feb 21, 2018
ansibot
added
bugfix_pull_request
needs_triage
Needs a first human triage before being processed.
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
labels
Feb 21, 2018
sivel
removed
the
needs_triage
Needs a first human triage before being processed.
label
Feb 21, 2018
* One fix: be sure to turn args into text before passing to _get_shebang() * Rename variables that contain bytes to b_* * Get rid of to_text() and to_bytes() calls that do nothing (because the data is already the proper type)
+1 to merge |
@abadger the changes LGTM. Tested against py3 and py2 and get the expected outcome. |
nitzmahone
approved these changes
Feb 22, 2018
abadger
pushed a commit
that referenced
this pull request
Feb 22, 2018
abadger
pushed a commit
to abadger/ansible
that referenced
this pull request
Feb 22, 2018
* Fix types when evaluating interpreter. Fixes ansible#36536 * Rename variables that contain bytes to b_* * Get rid of to_text() and to_bytes() calls that do nothing (because the data is already the proper type) (cherry picked from commit a4df4d3)
Merged to devel. cherrypicked for 2.4.4-beta1. PR #36561 opened to cherrypick to stable-2.5 for 2.5.0rc1 |
abadger
added a commit
that referenced
this pull request
Feb 22, 2018
* Fix types when evaluating interpreter (#36541) * Fix types when evaluating interpreter. Fixes #36536 * Rename variables that contain bytes to b_* * Get rid of to_text() and to_bytes() calls that do nothing (because the data is already the proper type) (cherry picked from commit a4df4d3) * Changelog entry for the ansible_*_interpreter fix
ansibot
added
bug
This issue/PR relates to a bug.
and removed
bugfix_pull_request
labels
Mar 6, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
bug
This issue/PR relates to a bug.
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
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.
SUMMARY
Fix types used in
modify_module
when evaluating the interpreter. Fixes #36536Using
str
inside ofshlex.split
results in['b/usr/bin/python']
. And passing a byte string to_get_shebang
produces aninterpreter_config
ofu"ansible_b'python'_interpreter"
which then wouldn't be located in task vars.ISSUE TYPE
COMPONENT NAME
lib/ansible/executor/module_common.py
ANSIBLE VERSION
ADDITIONAL INFORMATION