Skip to content
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 string/binary encoding issue in pull.py #36962

Closed
jfinkhaeuser opened this issue Mar 3, 2018 · 2 comments · Fixed by #37606
Closed

Fix string/binary encoding issue in pull.py #36962

jfinkhaeuser opened this issue Mar 3, 2018 · 2 comments · Fixed by #37606
Labels
affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. needs_info This issue requires further information. Please answer any outstanding questions. python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@jfinkhaeuser
Copy link

jfinkhaeuser commented Mar 3, 2018

ISSUE TYPE
  • Bug Report
COMPONENT NAME

lib/ansible/cli/pull.py

ANSIBLE VERSION

Current

CONFIGURATION

Python 3

OS / ENVIRONMENT

Linux

SUMMARY
-        elif self.options.ifchanged and '"changed": true' not in out:
+        elif self.options.ifchanged and b'"changed": true' not in out:

The value in out is always binary encoded, because it's returned that way from run_cmd.

STEPS TO REPRODUCE

Run ansible-pull

EXTRA

Replaces #36364 - I'm closing that PR, because that bot annoys the crap out of me.

@ansibot
Copy link
Contributor

ansibot commented Mar 3, 2018

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Mar 3, 2018
@alikins alikins removed the needs_triage Needs a first human triage before being processed. label Mar 5, 2018
@jfinkhaeuser
Copy link
Author

+label affects_2.1
+label affects_2.2
+label affects_2.3
+label affects_2.4
+label affects_2.5

Yeah, no, not just 2.6.

@ansibot ansibot added the needs_info This issue requires further information. Please answer any outstanding questions. label Mar 19, 2018
bcoca added a commit to bcoca/ansible that referenced this issue Mar 19, 2018
abadger added a commit to abadger/ansible that referenced this issue Mar 19, 2018
* Fix a traceback in ansible-pull on python3 comparing output from
  subprocess with a text string.
* Rename variables that hold byte strings so we are clear that those are
  not text strings.
* Use to_text() to transform variable that's being displayed as it's
  less fragile than str().

Fixes ansible#36962
abadger added a commit to abadger/ansible that referenced this issue Mar 20, 2018
* Fix a traceback in ansible-pull on python3 comparing output from
  subprocess with a text string.
* Rename variables that hold byte strings so we are clear that those are
  not text strings.
* Use to_text() to transform variable that's being displayed as it's
  less fragile than str().

Fixes ansible#36962

(cherry picked from commit b98ad3a)
abadger added a commit that referenced this issue Mar 20, 2018
* Fix a traceback in ansible-pull on python3 comparing output from
  subprocess with a text string.
* Rename variables that hold byte strings so we are clear that those are
  not text strings.
* Use to_text() to transform variable that's being displayed as it's
  less fragile than str().

Fixes #36962
@abadger abadger moved this from TODO to Done in Python 3 compatibility Mar 20, 2018
nitzmahone pushed a commit that referenced this issue Mar 29, 2018
* Compare byte strings to byte strings

* Fix a traceback in ansible-pull on python3 comparing output from
  subprocess with a text string.
* Rename variables that hold byte strings so we are clear that those are
  not text strings.
* Use to_text() to transform variable that's being displayed as it's
  less fragile than str().

Fixes #36962

(cherry picked from commit b98ad3a)

* Add changelog entry for python3 ansible-pull fix
abadger added a commit that referenced this issue Mar 29, 2018
* Fix a traceback in ansible-pull on python3 comparing output from
  subprocess with a text string.
* Rename variables that hold byte strings so we are clear that those are
  not text strings.
* Use to_text() to transform variable that's being displayed as it's
  less fragile than str().

Fixes #36962

(cherry picked from commit b98ad3a)
@ansible ansible locked and limited conversation to collaborators Apr 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. needs_info This issue requires further information. Please answer any outstanding questions. python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
No open projects
3 participants