def METHOD_NAME(s, d):
    error_string = "Yaml variable substitution error: '%s' could not be resolved."
    try:
        template = Template(s)
        s = template.substitute(d)
    except KeyError as e:
        raise OnlYamlError(error_string % (e.args[0]))
    except:
        raise
    return s