<s> from __future__ import absolute_import <EOL> from StringIO import StringIO <EOL> from salt . exceptions import SaltRenderError <EOL> import salt . utils . templates <EOL> def render ( template_file , <EOL> saltenv = '<STR_LIT>' , <EOL> sls = '<STR_LIT>' , <EOL> argline = '<STR_LIT>' , <EOL> context = None , <EOL> ** kws ) : <EOL> '''<STR_LIT>''' <EOL> tmp_data = salt . utils . templates . WEMPY ( template_file , to_str = True , <EOL> salt = __salt__ , <EOL> grains = __grains__ , <EOL> opts = __opts__ , <EOL> pillar = __pillar__ , <EOL> saltenv = saltenv , <EOL> sls = sls , <EOL> context = context , <EOL> ** kws ) <EOL> if not tmp_data . get ( '<STR_LIT:result>' , False ) : <EOL> raise SaltRenderError ( tmp_data . get ( '<STR_LIT:data>' , <EOL> '<STR_LIT>' ) ) <EOL> return StringIO ( tmp_data [ '<STR_LIT:data>' ] ) </s>
