saltstack/salt — Issue #850: Minion restarts services when 'test: True' is set
Author: gerard-lynch
Created: 2012-03-06 09:41:14+00:00
State: open

Salt 0.9.6-2
CentOS 6

My understanding is that "test: True" in /etc/salt/minion should pretend to apply a state, but not actually perform any actions. However I'm seeing at least one real service restart. Noticed becaues there was a slight pause in the output.

[root@fry ~]# salt-call -l debug state.highstate
[...]
[INFO ] Executing state service.running for diamond
[INFO ] Executing command ps -efH | grep diamond | grep -v grep | awk '{print $2}' in directory /root
[DEBUG ] 13586

[INFO ] No changes made for diamond
[INFO ] Executing state service.watcher for diamond
[INFO ] Executing command ps -efH | grep diamond | grep -v grep | awk '{print $2}' in directory /root
[DEBUG ] 13586

[INFO ] Executing command service diamond restart in directory /root
[INFO ] {'diamond': True}
[...]

following which
[root@fry ~]# ps -efH | grep diamond | grep -v grep | awk '{print $2}'
14541

Looks like the 'service watch' function is not aware of the 'test' condition.
Not verified on 0.9.7+