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

Compare byte strings to byte strings #37606

Merged
merged 1 commit into from Mar 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/ansible/cli/pull.py
Expand Up @@ -30,7 +30,7 @@

from ansible.cli import CLI
from ansible.errors import AnsibleOptionsError
from ansible.module_utils._text import to_native
from ansible.module_utils._text import to_native, to_text
from ansible.plugins.loader import module_loader
from ansible.utils.cmd_functions import run_cmd

Expand Down Expand Up @@ -238,14 +238,14 @@ def run(self):
# RUN the Checkout command
display.debug("running ansible with VCS module to checkout repo")
display.vvvv('EXEC: %s' % cmd)
rc, out, err = run_cmd(cmd, live=True)
rc, b_out, b_err = run_cmd(cmd, live=True)

if rc != 0:
if self.options.force:
display.warning("Unable to update repository. Continuing with (forced) run of playbook.")
else:
return rc
elif self.options.ifchanged and '"changed": true' not in out:
elif self.options.ifchanged and b'"changed": true' not in b_out:
display.display("Repository has not changed, quitting.")
return 0

Expand Down Expand Up @@ -287,14 +287,14 @@ def run(self):
# RUN THE PLAYBOOK COMMAND
display.debug("running ansible-playbook to do actual work")
display.debug('EXEC: %s' % cmd)
rc, out, err = run_cmd(cmd, live=True)
rc, b_out, b_err = run_cmd(cmd, live=True)

if self.options.purge:
os.chdir('/')
try:
shutil.rmtree(self.options.dest)
except Exception as e:
display.error("Failed to remove %s: %s" % (self.options.dest, str(e)))
display.error(u"Failed to remove %s: %s" % (self.options.dest, to_text(e)))

return rc

Expand Down