saltstack/salt — Issue #623: Better Template error feedback
Author: fatbox
Created: 2012-02-01 16:43:17+00:00
State: open

I was making changes to a module today and ended up causing myself nearly 30 minutes of debugging by doing:

{% from "fatbox/apache2.sls" import a2site %}

When what I really meant was:

{% from "fatbox/apache2/init.sls" import a2site %}

Trying to apply this state caused the following (very cryptic) error:

[INFO ] Loading fresh modules for state activity
[INFO ] Loading fresh modules for state activity
local:
Data failed to compile:
----------
Rendering SLS my.sls failed, render error:
local variable 'f' referenced before assignment

I'd love to see a module command added that would return the compiled YAML (before it has been turned into a Python object) so that macro construction output can be examined and errors like this would be less cryptic to debug.