saltstack/salt — pull request #7688 by johnnoone (2013-10-09 09:56:48+00:00)
Title: .sls data regression while 

Ordering states & pillar introduced a bug on template resolution:

- before 0.17 .sls contents were resolved has python dict. and there repr() could be parsed by YAML as mapping.
- with 0.17 .sls contents are resolved has python OrderedDict. and there repr() are parsed by YAML as string.

for example, this pillar:

```yaml
config:
foo: 42
bar: null
```

and this template

```yaml
data: {{ pillar['config'] }}
```

is rendered on 0.17 like this

```yaml
data: "OrderedDict([('foo', 42), ('bar', None)])"
```

this pull request implement a jinja2.environment.finalize that ensure that any python dict and OrderedDict are YAML friendly.

So, with the same example, template will be resolved as

```yaml
data: {'foo': 42, 'bar': None}
```