saltstack/salt — pull request #5487 by mlister2006 (2013-06-11 21:36:31+00:00)
Title:  Ignoring multiple spaces or tabs, while checking for sysctl changes.

For states.sysctl() , test=True seems to always show a pending (at least on CentOS platform). The original code under states.sysctl.present() checks for exact string match between sysctl parameters value coming from a state file and sysctl value read via sysctl -a (used by modules.sysctl.show() call, that always contains tab separated values).

This fix will ignore multiple spaces or tabs while comparing (by normalizing with single space)

e.g: mystate.sls

net.ipv4.tcp_rmem:
sysctl:
- present
- value: 4096 87380 16777216

value: contains single space separated numerals, however after applying above state successfully, sysctl -a shows tab separated values (kernel presents it that way) and subsequent salt '*' state.sls mystate test=True always shows a pending update.