Return the rendered script

def __render_script(path, vm_=None, opts=None, minion=''):
    '''
    Return the rendered script
    '''
    log.info('Rendering deploy script: %s', path)
    try:
        with salt.utils.files.fopen(path, 'r') as fp_:
            template = Template(salt.utils.stringutils.to_unicode(fp_.read()))
            return six.text_type(template.render(opts=opts, vm=vm_, minion=minion))
    except AttributeError:
        # Specified renderer was not found
        with salt.utils.files.fopen(path, 'r') as fp_:
            return six.text_type(fp_.read())