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
836fb414
Commit
836fb414
authored
Jan 07, 2014
by
Serge van Ginderachter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
path_dwim: fix when basedir not set
parent
ea4eb3f8
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 @
836fb414
...
...
@@ -28,6 +28,7 @@ class ActionModule(object):
def
__init__
(
self
,
runner
):
self
.
runner
=
runner
self
.
basedir
=
runner
.
basedir
def
run
(
self
,
conn
,
tmp
,
module_name
,
module_args
,
inject
,
complex_args
=
None
,
**
kwargs
):
args
=
{}
...
...
@@ -50,7 +51,7 @@ class ActionModule(object):
else
:
result
=
dict
(
msg
=
args
[
'msg'
])
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
# force flag to make debug output module always verbose
...
...
lib/ansible/utils/__init__.py
View file @
836fb414
...
...
@@ -250,6 +250,8 @@ def path_dwim(basedir, given):
elif
given
.
startswith
(
"~"
):
return
os
.
path
.
abspath
(
os
.
path
.
expanduser
(
given
))
else
:
if
basedir
is
None
:
basedir
=
"."
return
os
.
path
.
abspath
(
os
.
path
.
join
(
basedir
,
given
))
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