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
5dd2ec2c
Commit
5dd2ec2c
authored
Nov 18, 2012
by
Daniel Hokka Zakrisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a way to add directories to just one type of loader
parent
d2abfb9f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
lib/ansible/inventory/__init__.py
+1
-1
lib/ansible/utils/plugins.py
+9
-1
No files found.
lib/ansible/inventory/__init__.py
View file @
5dd2ec2c
...
...
@@ -68,7 +68,7 @@ class Inventory(object):
host_list
=
[
h
for
h
in
host_list
if
h
and
h
.
strip
()
]
else
:
utils
.
plugins
.
push_basedir
(
self
.
basedir
())
utils
.
plugins
.
vars_loader
.
add_directory
(
self
.
basedir
())
if
type
(
host_list
)
==
list
:
all
=
Group
(
'all'
)
...
...
lib/ansible/utils/plugins.py
View file @
5dd2ec2c
...
...
@@ -42,6 +42,7 @@ class PluginLoader(object):
self
.
subdir
=
subdir
self
.
aliases
=
aliases
self
.
_module_cache
=
{}
self
.
_extra_dirs
=
[]
def
_get_package_path
(
self
):
"""Gets the path of a Python package"""
...
...
@@ -55,7 +56,14 @@ class PluginLoader(object):
"""Return a list of paths to search for plugins in
The list is searched in order."""
return
[
os
.
path
.
join
(
basedir
,
self
.
subdir
)
for
basedir
in
_basedirs
]
+
self
.
config
.
split
(
os
.
pathsep
)
+
[
self
.
_get_package_path
()]
return
self
.
_extra_dirs
+
[
os
.
path
.
join
(
basedir
,
self
.
subdir
)
for
basedir
in
_basedirs
]
+
self
.
config
.
split
(
os
.
pathsep
)
+
[
self
.
_get_package_path
()]
def
add_directory
(
self
,
directory
):
"""Adds an additional directory to the search path"""
self
.
_extra_dirs
.
append
(
directory
)
def
find_plugin
(
self
,
name
):
"""Find a plugin named name"""
...
...
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