mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #15466 from cimarronm/correct_test_result_states.file.prepend
Bugfix for result returned from states.file.prepend with test option
This commit is contained in:
commit
d5602028ce
@ -3145,7 +3145,6 @@ def prepend(name,
|
||||
|
||||
if __opts__['test']:
|
||||
nlines = test_lines + slines
|
||||
ret['result'] = None
|
||||
if slines != nlines:
|
||||
if not salt.utils.istextfile(name):
|
||||
ret['changes']['diff'] = 'Replace binary file'
|
||||
@ -3154,8 +3153,10 @@ def prepend(name,
|
||||
ret['changes']['diff'] = (
|
||||
''.join(difflib.unified_diff(slines, nlines))
|
||||
)
|
||||
ret['result'] = None
|
||||
else:
|
||||
ret['comment'] = 'File {0} is in correct state'.format(name)
|
||||
ret['result'] = True
|
||||
return ret
|
||||
|
||||
__salt__['file.prepend'](name, *preface)
|
||||
|
Loading…
Reference in New Issue
Block a user