def _render_filenames(path, dest, saltenv, template, **kw):
 if (not template):
  return (path, dest)
 if (template not in salt.utils.templates.TEMPLATE_REGISTRY):
  raise CommandExecutionError('Attempted to render file paths with unavailable engine {0}'.format(template))
 kwargs = {}
 kwargs['salt'] = __salt__
 if (('pillarenv' in kw) or ('pillar' in kw)):
  pillarenv = kw.get('pillarenv', __opts__.get('pillarenv'))
  kwargs['pillar'] = _gather_pillar(pillarenv, kw.get('pillar'))
 else:
  kwargs['pillar'] = __pillar__
 kwargs['grains'] = __grains__
 kwargs['opts'] = __opts__
 kwargs['saltenv'] = saltenv
 def _render(contents):
  '\n        Render :param:`contents` into a literal pathname by writing it to a\n        temp file, rendering that file, and returning the result.\n        '
  tmp_path_fn = salt.utils.files.mkstemp()
  with salt.utils.fopen(tmp_path_fn, 'w+') as fp_:
   fp_.write(contents)
  data = salt.utils.templates.TEMPLATE_REGISTRY[template](tmp_path_fn, to_str=True, **kwargs)
  salt.utils.safe_rm(tmp_path_fn)
  if (not data['result']):
   raise CommandExecutionError('Failed to render file path with error: {0}'.format(data['data']))
  else:
   return data['data']
 path = _render(path)
 dest = _render(dest)
 return (path, dest)

def _render_filenames ( path , dest , saltenv , template , ** kw ) : if ( not template ) : return ( path , dest ) if ( template not in salt . utils . templates . TEMPLATE_REGISTRY ) : raise CommandExecutionError ( 'Attempted to render file paths with unavailable engine {0}' . format ( template ) ) kwargs = { } kwargs [ 'salt' ] = __salt__ if ( ( 'pillarenv' in kw ) or ( 'pillar' in kw ) ) : pillarenv = kw . get ( 'pillarenv' , __opts__ . get ( 'pillarenv' ) ) kwargs [ 'pillar' ] = _gather_pillar ( pillarenv , kw . get ( 'pillar' ) ) else : kwargs [ 'pillar' ] = __pillar__ kwargs [ 'grains' ] = __grains__ kwargs [ 'opts' ] = __opts__ kwargs [ 'saltenv' ] = saltenv def _render ( contents ) : tmp_path_fn = salt . utils . files . mkstemp ( ) with salt . utils . fopen ( tmp_path_fn , 'w+' ) as fp_ : fp_ . write ( contents ) data = salt . utils . templates . TEMPLATE_REGISTRY [ template ] ( tmp_path_fn , to_str = True , ** kwargs ) salt . utils . safe_rm ( tmp_path_fn ) if ( not data [ 'result' ] ) : raise CommandExecutionError ( 'Failed to render file path with error: {0}' . format ( data [ 'data' ] ) ) else : return data [ 'data' ] path = _render ( path ) dest = _render ( dest ) return ( path , dest )
process markup in the .