Fix reporting of file.blockreplace state when test=True

When test=True is used, this state does a dry run and doesn't change the
file (as expected), but reports that changes were made. This commit
fixes the reporting so that it states that changes would have been made.
This commit is contained in:
Erik Johnson 2013-12-10 11:44:20 -06:00
parent a54ed65b79
commit 4464da4423

View File

@ -1990,11 +1990,16 @@ def blockreplace(name,
if changes:
ret['changes'] = {'diff': changes}
if __opts__['test']:
ret['result'] = None
ret['comment'] = 'Changes would be made'
else:
ret['result'] = True
ret['comment'] = 'Changes were made'
else:
ret['comment'] = 'No changes were made'
ret['result'] = True
ret['comment'] = 'No changes needed to be made'
return ret