Have to turn things into lists now? Maybe Ansible 2.2?

This commit is contained in:
Dhruv Bansal 2016-12-19 22:39:44 -06:00
parent 96eb5e2c6d
commit b8f22589ce
3 changed files with 3 additions and 3 deletions

View file

@ -187,7 +187,7 @@ class LdapAttr(object):
if not (isinstance(values, list) and all(isinstance(value, basestring) for value in values)): if not (isinstance(values, list) and all(isinstance(value, basestring) for value in values)):
self.module.fail_json(msg="values must be a string or list of strings.") self.module.fail_json(msg="values must be a string or list of strings.")
return map(self._force_utf8, values) return list(map(self._force_utf8, values))
def main(self): def main(self):
if self.state == 'present': if self.state == 'present':

View file

@ -147,7 +147,7 @@ class LdapEntry(object):
if not (isinstance(values, list) and all(isinstance(value, basestring) for value in values)): if not (isinstance(values, list) and all(isinstance(value, basestring) for value in values)):
self.module.fail_json(msg="{} must be a string or list of strings.".format(name)) self.module.fail_json(msg="{} must be a string or list of strings.".format(name))
return map(self._force_utf8, values) return list(map(self._force_utf8, values))
def _force_utf8(self, value): def _force_utf8(self, value):
""" If value is unicode, encode to utf-8. """ """ If value is unicode, encode to utf-8. """

View file

@ -146,7 +146,7 @@ class LdapUpsert(object):
if not (isinstance(values, list) and all(isinstance(value, basestring) for value in values)): if not (isinstance(values, list) and all(isinstance(value, basestring) for value in values)):
self.module.fail_json(msg="{} must be a string or list of strings.".format(name)) self.module.fail_json(msg="{} must be a string or list of strings.".format(name))
return map(self._force_utf8, values) return list(map(self._force_utf8, values))
def main(self): def main(self):