Skip to content

Commit

Permalink
ensure we are checking text for text
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoca committed Mar 19, 2018
1 parent e541bed commit db2a99b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 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 @@ -245,7 +245,8 @@ def run(self):
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:
# FIXME: this check is fragile, we should find better way to do change detection
elif self.options.ifchanged and '"changed": true' not in to_text(out):
display.display("Repository has not changed, quitting.")
return 0

Expand Down

0 comments on commit db2a99b

Please sign in to comment.