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
e88d6263
Commit
e88d6263
authored
Jun 10, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #460 from emgee/module-paths-2
Search multiple paths for modules.
parents
c1b02d78
5fe75238
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
lib/ansible/runner/__init__.py
+8
-3
lib/ansible/utils.py
+1
-1
No files found.
lib/ansible/runner/__init__.py
View file @
e88d6263
...
...
@@ -722,9 +722,14 @@ class Runner(object):
if
module
.
startswith
(
"/"
):
raise
errors
.
AnsibleFileNotFound
(
"
%
s is not a module"
%
module
)
in_path
=
os
.
path
.
expanduser
(
os
.
path
.
join
(
self
.
module_path
,
module
))
if
not
os
.
path
.
exists
(
in_path
):
raise
errors
.
AnsibleFileNotFound
(
"module not found:
%
s"
%
in_path
)
# Search module path(s) for named module.
for
module_path
in
self
.
module_path
.
split
(
os
.
pathsep
):
in_path
=
os
.
path
.
expanduser
(
os
.
path
.
join
(
module_path
,
module
))
if
os
.
path
.
exists
(
in_path
):
break
else
:
raise
errors
.
AnsibleFileNotFound
(
"module
%
s not found in
%
s"
%
(
module
,
self
.
module_path
))
out_path
=
tmp
+
module
...
...
lib/ansible/utils.py
View file @
e88d6263
...
...
@@ -323,7 +323,7 @@ def base_parser(constants=C, usage="", output_opts=False, runas_opts=False, asyn
parser
.
add_option
(
'-K'
,
'--ask-sudo-pass'
,
default
=
False
,
dest
=
'ask_sudo_pass'
,
action
=
'store_true'
,
help
=
'ask for sudo password'
)
parser
.
add_option
(
'-M'
,
'--module-path'
,
dest
=
'module_path'
,
help
=
"specify path
to module library (default=
%
s)"
%
constants
.
DEFAULT_MODULE_PATH
,
help
=
"specify path
(s) to module library (default=
%
s)"
%
constants
.
DEFAULT_MODULE_PATH
,
default
=
constants
.
DEFAULT_MODULE_PATH
)
parser
.
add_option
(
'-T'
,
'--timeout'
,
default
=
constants
.
DEFAULT_TIMEOUT
,
type
=
'int'
,
dest
=
'timeout'
,
...
...
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