mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
In file.sed: "after" is not a regular expression
This commit is contained in:
parent
e26322f567
commit
629363eaf6
@ -1205,7 +1205,7 @@ def sed(name, before, after, limit='', backup='.bak', options='-r -e',
|
||||
# Look for the pattern before attempting the edit
|
||||
if not __salt__['file.contains_regex'](name, before):
|
||||
# Pattern not found; try to guess why
|
||||
if __salt__['file.contains_regex'](name, after):
|
||||
if __salt__['file.contains'](name, after):
|
||||
ret['comment'] = 'Edit already performed'
|
||||
ret['result'] = True
|
||||
return ret
|
||||
@ -1225,7 +1225,7 @@ def sed(name, before, after, limit='', backup='.bak', options='-r -e',
|
||||
nlines = fp_.readlines()
|
||||
|
||||
# check the result
|
||||
ret['result'] = __salt__['file.contains_regex'](name, after)
|
||||
ret['result'] = __salt__['file.contains'](name, after)
|
||||
if slines != nlines:
|
||||
# Changes happened, add them
|
||||
ret['changes']['diff'] = (
|
||||
|
Loading…
Reference in New Issue
Block a user