summaryrefslogtreecommitdiffstats
path: root/roles/openshift_master_facts
diff options
context:
space:
mode:
authorRussell Teague <rteague@redhat.com>2017-03-31 15:03:39 -0400
committerRussell Teague <rteague@redhat.com>2017-04-03 14:39:35 -0400
commit203630f47e6d06e5575a9e3bb4db76cb12ead936 (patch)
tree8434ddd592d812ac0f70141aa9c962364c2fd965 /roles/openshift_master_facts
parent0bac74c346bb5c620bdf1941b40c29ff3083e2b0 (diff)
downloadopenshift-203630f47e6d06e5575a9e3bb4db76cb12ead936.tar.gz
openshift-203630f47e6d06e5575a9e3bb4db76cb12ead936.tar.bz2
openshift-203630f47e6d06e5575a9e3bb4db76cb12ead936.tar.xz
openshift-203630f47e6d06e5575a9e3bb4db76cb12ead936.zip
Support unicode output when dumping yaml
Diffstat (limited to 'roles/openshift_master_facts')
-rw-r--r--roles/openshift_master_facts/filter_plugins/openshift_master.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/roles/openshift_master_facts/filter_plugins/openshift_master.py b/roles/openshift_master_facts/filter_plugins/openshift_master.py
index 01806c97f..e570392ff 100644
--- a/roles/openshift_master_facts/filter_plugins/openshift_master.py
+++ b/roles/openshift_master_facts/filter_plugins/openshift_master.py
@@ -14,9 +14,12 @@ from distutils.version import LooseVersion # pylint: disable=no-name-in-module,
from ansible import errors
from ansible.parsing.yaml.dumper import AnsibleDumper
from ansible.plugins.filter.core import to_bool as ansible_bool
-# pylint import-error disabled because pylint cannot find the package
-# when installed in a virtualenv
-from ansible.compat.six import string_types # pylint: disable=no-name-in-module,import-error
+
+# ansible.compat.six goes away with Ansible 2.4
+try:
+ from ansible.compat.six import string_types, u
+except ImportError:
+ from ansible.module_utils.six import string_types, u
import yaml
@@ -490,10 +493,10 @@ class FilterModule(object):
idp_list.append(idp_inst)
IdentityProviderBase.validate_idp_list(idp_list, openshift_version, deployment_type)
- return yaml.dump([idp.to_dict() for idp in idp_list],
- allow_unicode=True,
- default_flow_style=False,
- Dumper=AnsibleDumper)
+ return u(yaml.dump([idp.to_dict() for idp in idp_list],
+ allow_unicode=True,
+ default_flow_style=False,
+ Dumper=AnsibleDumper))
@staticmethod
def validate_pcs_cluster(data, masters=None):