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
f3d72946
Commit
f3d72946
authored
Oct 11, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test for directory existance, fix exception catching granularity
parent
448c89a0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
lib/ansible/playbook/task.py
+9
-5
lib/ansible/runner/__init__.py
+1
-1
No files found.
lib/ansible/playbook/task.py
View file @
f3d72946
...
...
@@ -41,9 +41,13 @@ class Task(object):
def
__init__
(
self
,
play
,
ds
,
module_vars
=
None
):
''' constructor loads from a task or handler datastructure '''
# code to allow for saying "modulename: args" versus "action: modulename args"
modules_list
=
set
()
for
path
in
C
.
DEFAULT_MODULE_PATH
.
split
(
pathsep
):
modules_list
.
update
(
os
.
listdir
(
path
))
if
os
.
path
.
exists
(
path
):
modules_list
.
update
(
os
.
listdir
(
path
))
modules_list
=
list
(
modules_list
)
for
x
in
ds
.
keys
():
if
x
in
modules_list
:
...
...
@@ -77,10 +81,10 @@ class Task(object):
# delegate_to can use variables
if
not
(
self
.
delegate_to
is
None
):
self
.
delegate_to
=
utils
.
template
(
None
,
self
.
delegate_to
,
self
.
module_vars
)
# delegate_to: localhost should use local transport
if
self
.
delegate_to
in
[
'127.0.0.1'
,
'localhost'
]:
self
.
transport
=
'local'
self
.
delegate_to
=
utils
.
template
(
None
,
self
.
delegate_to
,
self
.
module_vars
)
# delegate_to: localhost should use local transport
if
self
.
delegate_to
in
[
'127.0.0.1'
,
'localhost'
]:
self
.
transport
=
'local'
# notified by is used by Playbook code to flag which hosts
# need to run a notifier
...
...
lib/ansible/runner/__init__.py
View file @
f3d72946
...
...
@@ -467,7 +467,7 @@ class Runner(object):
data2
=
utils
.
last_non_blank_line
(
data
)
try
:
return
data2
.
split
()[
0
]
except
:
except
IndexError
:
sys
.
stderr
.
write
(
"warning: md5sum command failed unusually, please report this to the list so it can be fixed
\n
"
)
sys
.
stderr
.
write
(
"command:
%
s
\n
"
%
md5s
)
sys
.
stderr
.
write
(
"----
\n
"
)
...
...
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