Merge pull request #48834 from gtmanfred/slsutil

read output of stringio if it is readable
This commit is contained in:
Nicole Thomas 2018-07-31 09:40:47 -04:00 committed by GitHub
commit 0a19f845ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -127,10 +127,12 @@ def renderer(path=None, string=None, default_renderer='jinja|yaml', **kwargs):
path_or_string = ':string:'
kwargs['input_data'] = string
return salt.template.compile_template(
path_or_string,
renderers,
default_renderer,
__opts__['renderer_blacklist'],
__opts__['renderer_whitelist'],
**kwargs)
ret = salt.template.compile_template(
path_or_string,
renderers,
default_renderer,
__opts__['renderer_blacklist'],
__opts__['renderer_whitelist'],
**kwargs
)
return ret.read() if __utils__['stringio.is_readable'](ret) else ret