mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
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:
parent
a54ed65b79
commit
4464da4423
@ -1990,11 +1990,16 @@ def blockreplace(name,
|
||||
|
||||
if changes:
|
||||
ret['changes'] = {'diff': changes}
|
||||
ret['comment'] = 'Changes were made'
|
||||
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'
|
||||
|
||||
ret['result'] = True
|
||||
return ret
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user