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
804b1302
Commit
804b1302
authored
Mar 01, 2013
by
Seth Vidal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check if the term is a dict so we can take a simple list of files (like first_available_file) takes
parent
dfad9407
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
27 deletions
+29
-27
lib/ansible/runner/lookup_plugins/first_found.py
+29
-27
No files found.
lib/ansible/runner/lookup_plugins/first_found.py
View file @
804b1302
...
...
@@ -81,34 +81,36 @@ class LookupModule(object):
def
run
(
self
,
terms
,
**
kwargs
):
result
=
None
for
term
in
terms
:
files
=
term
.
get
(
'files'
,
[])
paths
=
term
.
get
(
'paths'
,
[])
filelist
=
files
if
isinstance
(
files
,
basestring
):
files
=
files
.
replace
(
','
,
' '
)
files
=
files
.
replace
(
';'
,
' '
)
filelist
=
files
.
split
(
' '
)
pathlist
=
paths
if
paths
:
if
isinstance
(
paths
,
basestring
):
paths
=
paths
.
replace
(
','
,
' '
)
paths
=
paths
.
replace
(
':'
,
' '
)
paths
=
paths
.
replace
(
';'
,
' '
)
pathlist
=
paths
.
split
(
' '
)
total_search
=
[]
if
not
pathlist
:
total_search
=
filelist
if
isinstance
(
term
,
dict
):
files
=
term
.
get
(
'files'
,
[])
paths
=
term
.
get
(
'paths'
,
[])
filelist
=
files
if
isinstance
(
files
,
basestring
):
files
=
files
.
replace
(
','
,
' '
)
files
=
files
.
replace
(
';'
,
' '
)
filelist
=
files
.
split
(
' '
)
pathlist
=
paths
if
paths
:
if
isinstance
(
paths
,
basestring
):
paths
=
paths
.
replace
(
','
,
' '
)
paths
=
paths
.
replace
(
':'
,
' '
)
paths
=
paths
.
replace
(
';'
,
' '
)
pathlist
=
paths
.
split
(
' '
)
total_search
=
[]
if
not
pathlist
:
total_search
=
filelist
else
:
for
path
in
pathlist
:
for
fn
in
filelist
:
f
=
path
+
'/'
+
fn
total_search
.
append
(
f
)
else
:
for
path
in
pathlist
:
for
fn
in
filelist
:
f
=
path
+
'/'
+
fn
total_search
.
append
(
f
)
total_search
=
[
term
]
result
=
None
for
fn
in
total_search
:
...
...
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