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
6c25ea1b
Commit
6c25ea1b
authored
Jan 30, 2014
by
jctanner
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5527 from sergevanginderachter/basedirdwim
path_dwim: fix when basedir not set
parents
f955d9db
836fb414
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletions
+4
-1
lib/ansible/runner/action_plugins/debug.py
+2
-1
lib/ansible/utils/__init__.py
+2
-0
No files found.
lib/ansible/runner/action_plugins/debug.py
View file @
6c25ea1b
...
@@ -28,6 +28,7 @@ class ActionModule(object):
...
@@ -28,6 +28,7 @@ class ActionModule(object):
def
__init__
(
self
,
runner
):
def
__init__
(
self
,
runner
):
self
.
runner
=
runner
self
.
runner
=
runner
self
.
basedir
=
runner
.
basedir
def
run
(
self
,
conn
,
tmp
,
module_name
,
module_args
,
inject
,
complex_args
=
None
,
**
kwargs
):
def
run
(
self
,
conn
,
tmp
,
module_name
,
module_args
,
inject
,
complex_args
=
None
,
**
kwargs
):
args
=
{}
args
=
{}
...
@@ -50,7 +51,7 @@ class ActionModule(object):
...
@@ -50,7 +51,7 @@ class ActionModule(object):
else
:
else
:
result
=
dict
(
msg
=
args
[
'msg'
])
result
=
dict
(
msg
=
args
[
'msg'
])
elif
'var'
in
args
:
elif
'var'
in
args
:
results
=
template
.
template
(
None
,
"{{
%
s }}"
%
args
[
'var'
],
inject
)
results
=
template
.
template
(
self
.
basedir
,
"{{
%
s }}"
%
args
[
'var'
],
inject
)
result
[
args
[
'var'
]]
=
results
result
[
args
[
'var'
]]
=
results
# force flag to make debug output module always verbose
# force flag to make debug output module always verbose
...
...
lib/ansible/utils/__init__.py
View file @
6c25ea1b
...
@@ -250,6 +250,8 @@ def path_dwim(basedir, given):
...
@@ -250,6 +250,8 @@ def path_dwim(basedir, given):
elif
given
.
startswith
(
"~"
):
elif
given
.
startswith
(
"~"
):
return
os
.
path
.
abspath
(
os
.
path
.
expanduser
(
given
))
return
os
.
path
.
abspath
(
os
.
path
.
expanduser
(
given
))
else
:
else
:
if
basedir
is
None
:
basedir
=
"."
return
os
.
path
.
abspath
(
os
.
path
.
join
(
basedir
,
given
))
return
os
.
path
.
abspath
(
os
.
path
.
join
(
basedir
,
given
))
def
path_dwim_relative
(
original
,
dirname
,
source
,
playbook_base
,
check
=
True
):
def
path_dwim_relative
(
original
,
dirname
,
source
,
playbook_base
,
check
=
True
):
...
...
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