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
b4476c23
Commit
b4476c23
authored
Aug 14, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use match() instead of search() for pattern matching
Also related to f48fa3, fix for #8614
parent
f48fa375
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
lib/ansible/inventory/__init__.py
+2
-2
No files found.
lib/ansible/inventory/__init__.py
View file @
b4476c23
...
@@ -162,14 +162,14 @@ class Inventory(object):
...
@@ -162,14 +162,14 @@ class Inventory(object):
results
=
[]
results
=
[]
try
:
try
:
if
not
pattern_str
.
startswith
(
'~'
):
if
not
pattern_str
.
startswith
(
'~'
):
pattern
=
re
.
compile
(
'^'
+
fnmatch
.
translate
(
pattern_str
))
pattern
=
re
.
compile
(
fnmatch
.
translate
(
pattern_str
))
else
:
else
:
pattern
=
re
.
compile
(
pattern_str
[
1
:])
pattern
=
re
.
compile
(
pattern_str
[
1
:])
except
Exception
,
e
:
except
Exception
,
e
:
raise
errors
.
AnsibleError
(
'invalid host pattern:
%
s'
%
pattern_str
)
raise
errors
.
AnsibleError
(
'invalid host pattern:
%
s'
%
pattern_str
)
for
item
in
items
:
for
item
in
items
:
if
pattern
.
sear
ch
(
getattr
(
item
,
item_attr
)):
if
pattern
.
mat
ch
(
getattr
(
item
,
item_attr
)):
results
.
append
(
item
)
results
.
append
(
item
)
return
results
return
results
...
...
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