Skip to content

Commit

Permalink
Cast idp name and kind to string to avoid yaml representer error for …
Browse files Browse the repository at this point in the history
…ansible.vars.unsafe_proxy.AnsibleUnsafeText type.
  • Loading branch information
abutcher committed Jan 17, 2017
1 parent b01d19b commit 8d3714f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions filter_plugins/openshift_master.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ def __init__(self, api_version, idp):
if 'kind' not in self._idp:
raise errors.AnsibleFilterError("|failed identity provider missing a kind")

self.name = self._idp.pop('name')
self.name = str(self._idp.pop('name'))

This comment has been minimized.

Copy link
@detiber

detiber Jan 18, 2017

Instead of str, should you use six.text_type instead? That would force it to unicode for both py2 and py3, instead of non-unicode for py2 and unicode for py3

self.login = ansible_bool(self._idp.pop('login', False))
self.challenge = ansible_bool(self._idp.pop('challenge', False))
self.provider = dict(apiVersion=api_version, kind=self._idp.pop('kind'))
self.provider = dict(apiVersion=api_version, kind=str(self._idp.pop('kind')))

mm_keys = ('mappingMethod', 'mapping_method')
mapping_method = None
Expand Down

0 comments on commit 8d3714f

Please sign in to comment.