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
14f7bba6
Commit
14f7bba6
authored
Nov 17, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1643 from dhozac/fileglob-drop-dwim
Drop dwim prefix from returned items in fileglob
parents
bb2e5e12
11afd84d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
+4
-1
lib/ansible/runner/lookup_plugins/fileglob.py
+4
-1
No files found.
lib/ansible/runner/lookup_plugins/fileglob.py
View file @
14f7bba6
...
...
@@ -25,7 +25,10 @@ class LookupModule(object):
self
.
basedir
=
basedir
def
run
(
self
,
terms
,
**
kwargs
):
return
[
f
for
f
in
glob
.
glob
(
utils
.
path_dwim
(
self
.
basedir
,
terms
))
if
os
.
path
.
isfile
(
f
)
]
dwimterms
=
utils
.
path_dwim
(
self
.
basedir
,
terms
)
# This skips whatever prefix the dwim added, leaving just the filename for the item
dwim_prefix_len
=
len
(
dwimterms
)
-
len
(
terms
)
return
[
f
[
dwim_prefix_len
:]
for
f
in
glob
.
glob
(
dwimterms
)
if
os
.
path
.
isfile
(
f
)
]
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