saltstack/salt — pull request #18365 by jacksontj (2014-11-21 17:36:45+00:00)
Title: Better output on requisite failure

Got the idea from #15663

Basically, on the failure we know what ran, and what our requisites are. So if we look for all of our requisites in the "things that ran" and look for failures, we'll find ours.

This means that for an SLS like:
```
foo:
cmd.run:
- name: 'date'
- prereq:
- foo: fail_one
- cmd: work

fail_one:
foo.run:
- name: 'exit 1'

work:
cmd.run:
- name: 'date'
```

The output goes from:
```
local:
----------
ID: foo
Function: cmd.run
Name: date
Result: False
Comment: One or more requisite failed
Started:
Duration:
Changes:
----------
ID: work
Function: cmd.run
Name: date
Result: None
Comment: Command "date" would have been executed
Started:
Duration:
Changes:
```

to:
```
local:
----------
ID: foo
Function: cmd.run
Name: date
Result: False
Comment: One or more requisite failed: {'test.fail_one': "State 'foo.run' found in SLS 'test' is unavailable\n"}
Started:
Duration:
Changes:
----------
ID: work
Function: cmd.run
Name: date
Result: None
Comment: Command "date" would have been executed
Started:
Duration:
Changes:
```