cfengine/core — pull request #96 by estenberg (2012-08-01 09:32:34+00:00)
Title: correct and clean up dry-run modes

Try to get rid of structures like the following for all promises.

switch (a.transaction.action)
{
case cfa_fix:
if (DONTDO)
{
/* warn that we won't do it */
}
else
{
/* do it */
}
break;

case cfa_warn:
/* warn that we won't do it */
break;
}

This is error-prone (sometimes we miss one of the cases), and a bit messy. Use a function to test both cases instead.

This assumes that DONTDO and cfa_warn is equivalent.