summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorOpenShift Bot <eparis+openshiftbot@redhat.com>2017-04-04 09:20:42 -0500
committerGitHub <noreply@github.com>2017-04-04 09:20:42 -0500
commit7496b1235f72bd4241e4917f50df722174bf90fa (patch)
tree1fd7d3adf2c6befbef794d23ea3a92f0b6ce82e3 /utils
parent68b31569f7867afd67915098712cc832df95e59d (diff)
parent203630f47e6d06e5575a9e3bb4db76cb12ead936 (diff)
downloadopenshift-7496b1235f72bd4241e4917f50df722174bf90fa.tar.gz
openshift-7496b1235f72bd4241e4917f50df722174bf90fa.tar.bz2
openshift-7496b1235f72bd4241e4917f50df722174bf90fa.tar.xz
openshift-7496b1235f72bd4241e4917f50df722174bf90fa.zip
Merge pull request #3808 from mtnbikenc/unicode-decode
Merged by openshift-bot
Diffstat (limited to 'utils')
-rw-r--r--utils/src/ooinstall/ansible_plugins/facts_callback.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/utils/src/ooinstall/ansible_plugins/facts_callback.py b/utils/src/ooinstall/ansible_plugins/facts_callback.py
index c881e4b92..433e29dde 100644
--- a/utils/src/ooinstall/ansible_plugins/facts_callback.py
+++ b/utils/src/ooinstall/ansible_plugins/facts_callback.py
@@ -7,6 +7,12 @@ import yaml
from ansible.plugins.callback import CallbackBase
from ansible.parsing.yaml.dumper import AnsibleDumper
+# ansible.compat.six goes away with Ansible 2.4
+try:
+ from ansible.compat.six import u
+except ImportError:
+ from ansible.module_utils.six import u
+
# pylint: disable=super-init-not-called
class CallbackModule(CallbackBase):
@@ -39,10 +45,10 @@ class CallbackModule(CallbackBase):
facts = abridged_result['result']['ansible_facts']['openshift']
hosts_yaml = {}
hosts_yaml[res._host.get_name()] = facts
- to_dump = yaml.dump(hosts_yaml,
- allow_unicode=True,
- default_flow_style=False,
- Dumper=AnsibleDumper)
+ to_dump = u(yaml.dump(hosts_yaml,
+ allow_unicode=True,
+ default_flow_style=False,
+ Dumper=AnsibleDumper))
os.write(self.hosts_yaml, to_dump)
def v2_runner_on_skipped(self, res):