Commit 14a9c3ab by Michael DeHaan

Line in file regexep should match a portion of the line, not the whole line!

parent 95540f40
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment