Adapt to_unicode and to_bytes for ansible 2.2
The config_template is using the old ansible objects, this should make it work with the newest standards. Change-Id: I9159be497c201ca6c2f558336843be5175f0ee2c Closes-Bug: 1640458
This commit is contained in:
parent
4e20bc0e6f
commit
5bf7a5c3f1
@ -34,7 +34,7 @@ import yaml
|
||||
|
||||
|
||||
from ansible.plugins.action import ActionBase
|
||||
from ansible.utils.unicode import to_bytes, to_unicode
|
||||
from ansible.module_utils._text import to_bytes, to_text
|
||||
from ansible import constants as C
|
||||
from ansible import errors
|
||||
|
||||
@ -510,7 +510,7 @@ class ActionModule(ActionBase):
|
||||
temp_vars['template_run_date'] = datetime.datetime.now()
|
||||
|
||||
with open(source, 'r') as f:
|
||||
template_data = to_unicode(f.read())
|
||||
template_data = to_text(f.read())
|
||||
|
||||
self._templar.environment.loader.searchpath = _vars['searchpath']
|
||||
self._templar.set_available_variables(temp_vars)
|
||||
|
Loading…
x
Reference in New Issue
Block a user