decode file contents for python2 as well

This commit is contained in:
Abid Mehmood 2018-08-01 17:55:02 +02:00 committed by rallytime
parent 1e150923aa
commit f40b966d99
No known key found for this signature in database
GPG key ID: E8F1A4B90D0DEA19

View file

@ -1118,8 +1118,7 @@ def _get_template_texts(source_list=None,
tmplines = None
with salt.utils.files.fopen(rndrd_templ_fn, 'rb') as fp_:
tmplines = fp_.read()
if six.PY3:
tmplines = tmplines.decode(__salt_system_encoding__)
tmplines = tmplines.decode(__salt_system_encoding__)
tmplines = tmplines.splitlines(True)
if not tmplines:
msg = 'Failed to read rendered template file {0} ({1})'