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
0f4b72cd
Commit
0f4b72cd
authored
Feb 26, 2015
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor loop to only calculate the full_path once
parent
68c99a12
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
lib/ansible/utils/plugins.py
+5
-6
No files found.
lib/ansible/utils/plugins.py
View file @
0f4b72cd
...
...
@@ -176,19 +176,18 @@ class PluginLoader(object):
found
=
None
for
path
in
[
p
for
p
in
self
.
_get_paths
()
if
p
not
in
self
.
_searched_paths
]:
if
os
.
path
.
isdir
(
path
):
f
or
potential_file
in
(
f
for
f
in
os
.
listdir
(
path
)
if
os
.
path
.
isfile
(
os
.
path
.
join
(
path
,
f
)
)):
f
ull_paths
=
(
os
.
path
.
join
(
path
,
f
)
for
f
in
os
.
listdir
(
path
)
)
for
full_path
in
(
f
for
f
in
full_paths
if
os
.
path
.
isfile
(
f
)):
for
suffix
in
suffixes
:
if
potential_file
.
endswith
(
suffix
):
full_path
=
os
.
path
.
join
(
path
,
potential_file
)
if
full_path
.
endswith
(
suffix
):
full_name
=
os
.
path
.
basename
(
full_path
)
break
else
:
# Yes, this is a for-else: http://bit.ly/1ElPkyg
continue
if
full_name
not
in
self
.
_plugin_path_cache
:
self
.
_plugin_path_cache
[
full_name
]
=
full_path
self
.
_searched_paths
.
add
(
path
)
for
full_name
in
potential_names
:
if
full_name
in
self
.
_plugin_path_cache
:
...
...
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