From ca71056ec50e7b51ca0eaebb7a716207ce1a00e6 Mon Sep 17 00:00:00 2001
From: Guilhem Moulin <guilhem@fripost.org>
Date: Thu, 8 Dec 2016 19:39:01 +0100
Subject: Make Ansible modules compatible with Ansible 2.2.0.0.

---
 lib/action_plugins/openldap.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'lib/action_plugins')

diff --git a/lib/action_plugins/openldap.py b/lib/action_plugins/openldap.py
index ad77abc..86ca41f 100644
--- a/lib/action_plugins/openldap.py
+++ b/lib/action_plugins/openldap.py
@@ -15,7 +15,8 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 from ansible.plugins.action import ActionBase
-from ansible.utils.unicode import to_bytes, to_unicode
+from ansible.utils.unicode import to_bytes
+from ansible.module_utils._text import to_text
 
 class ActionModule(ActionBase):
     TRANSFERS_FILES = True
@@ -56,7 +57,7 @@ class ActionModule(ActionBase):
             # template the source data locally
             try:
                 with open(target, 'r') as f:
-                    template_data = to_unicode(f.read())
+                    template_data = to_text(f.read())
                 target = self._templar.template(template_data, preserve_trailing_newlines=True, escape_backslashes=False, convert_data=False)
             except Exception as e:
                 result['failed'] = True
-- 
cgit v1.2.3