Line in file regexep should match a portion of the line, not the whole line!
This commit is contained in:
parent
65f6515e3d
commit
9998d2985c
1 changed files with 2 additions and 2 deletions
|
@ -27,8 +27,8 @@ def present(module, name, regexp, line, insertafter, backup):
|
|||
f.close()
|
||||
|
||||
mre = re.compile(regexp)
|
||||
if not mre.match(line):
|
||||
module.fail_json(msg="line= doesn't match regexp=")
|
||||
if not mre.search(line):
|
||||
module.fail_json(msg="usage error: line= doesn't match regexp (%s)" % regexp)
|
||||
|
||||
if insertafter in ('BOF', 'EOF'):
|
||||
iare = None
|
||||
|
|
Loading…
Reference in a new issue