saltstack/salt — pull request #2667 by kjkuan (2012-11-22 07:35:08+00:00)
Title: Simplify the handling of the stateful feature of the cmd state.

Also fixed a bug in state.py along the way. The bug can be triggered
with this sls::

watched:
cmd.run:
- name: echo "This state is being watched!"
- cwd: /

watching:
cmd.wait:
- name: echo "I'm watching...." >> /tmp/watching.txt
- cwd: /
- watch:
- cmd: watched

test:
cmd.wait:
- name: echo "do something"
- cwd: /
- watch:
- cmd: watching

BTW, the behavior of a state with the 'watch' requisite really needs
to be better documented! I'll open another issue probably tomorrow to clarify a few things and maybe update the docs once it's clear.