Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
565f3361
Commit
565f3361
authored
Sep 08, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lineinfile should use 'search' everywhere
parent
14a9c3ab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
library/lineinfile
+3
-3
No files found.
library/lineinfile
View file @
565f3361
...
@@ -37,9 +37,9 @@ def present(module, name, regexp, line, insertafter, backup):
...
@@ -37,9 +37,9 @@ def present(module, name, regexp, line, insertafter, backup):
index
=
[
-
1
,
-
1
]
index
=
[
-
1
,
-
1
]
for
lineno
in
range
(
0
,
len
(
lines
)):
for
lineno
in
range
(
0
,
len
(
lines
)):
if
mre
.
mat
ch
(
lines
[
lineno
]):
if
mre
.
sear
ch
(
lines
[
lineno
]):
index
[
0
]
=
lineno
index
[
0
]
=
lineno
elif
iare
is
not
None
and
iare
.
mat
ch
(
lines
[
lineno
]):
elif
iare
is
not
None
and
iare
.
sear
ch
(
lines
[
lineno
]):
# + 1 for the next line
# + 1 for the next line
index
[
1
]
=
lineno
+
1
index
[
1
]
=
lineno
+
1
...
@@ -84,7 +84,7 @@ def absent(module, name, regexp, backup):
...
@@ -84,7 +84,7 @@ def absent(module, name, regexp, backup):
cre
=
re
.
compile
(
regexp
)
cre
=
re
.
compile
(
regexp
)
found
=
[]
found
=
[]
def
matcher
(
line
):
def
matcher
(
line
):
if
cre
.
mat
ch
(
line
):
if
cre
.
sear
ch
(
line
):
found
.
append
(
line
)
found
.
append
(
line
)
return
False
return
False
else
:
else
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment