Set the correct return message.
In these cases, the lines are added, not replaced.
This commit is contained in:
parent
150f5cb232
commit
3216c31401
1 changed files with 2 additions and 2 deletions
|
@ -338,12 +338,12 @@ def present(module, dest, regexp, line, insertafter, insertbefore, create,
|
|||
if index[1] <= 0:
|
||||
if b_lines[index[1]].rstrip(b('\r\n')) != b_line:
|
||||
b_lines.insert(index[1], b_line + b_linesep)
|
||||
msg = 'line replaced'
|
||||
msg = 'line added'
|
||||
changed = True
|
||||
|
||||
elif b_lines[index[1] - 1].rstrip(b('\r\n')) != b_line:
|
||||
b_lines.insert(index[1], b_line + b_linesep)
|
||||
msg = 'line replaced'
|
||||
msg = 'line added'
|
||||
changed = True
|
||||
|
||||
elif b_lines[index[0]] != b_new_line:
|
||||
|
|
Loading…
Reference in a new issue