summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetros Moisiadis <pmoisiadis@modulus.gr>2012-08-01 22:17:16 +0300
committerPetros Moisiadis <pmoisiadis@modulus.gr>2012-08-01 22:17:16 +0300
commit2ac4acbf9760a1bdc80a2ad7c15e4b9128168ce6 (patch)
tree04bba2b6268497b772fd750d840cbd12f0d7a2e6
parent5f4bf813b148069eb6af1621e06d94f6817d64b0 (diff)
downloadansible-2ac4acbf9760a1bdc80a2ad7c15e4b9128168ce6.tar.gz
fixes for tests
-rw-r--r--lib/ansible/callbacks.py6
-rw-r--r--lib/ansible/runner/__init__.py2
-rw-r--r--test/TestPlayBook.py4
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/ansible/callbacks.py b/lib/ansible/callbacks.py
index 2a49316122..f32a56ebbb 100644
--- a/lib/ansible/callbacks.py
+++ b/lib/ansible/callbacks.py
@@ -147,7 +147,7 @@ class DefaultRunnerCallbacks(object):
def __init__(self):
pass
- def on_failed(self, host, res):
+ def on_failed(self, host, res, ignore_errors=False):
pass
def on_ok(self, host, res):
@@ -185,7 +185,7 @@ class CliRunnerCallbacks(DefaultRunnerCallbacks):
self.options = None
self._async_notified = {}
- def on_failed(self, host, res):
+ def on_failed(self, host, res, ignore_errors=False):
self._on_any(host,res)
@@ -259,7 +259,7 @@ class PlaybookRunnerCallbacks(DefaultRunnerCallbacks):
else:
print "fatal: [%s] => %s" % (host, msg)
- def on_failed(self, host, results, ignore_errors):
+ def on_failed(self, host, results, ignore_errors=False):
item = results.get('item', None)
diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py
index 351bbf977a..9ab2fc6edb 100644
--- a/lib/ansible/runner/__init__.py
+++ b/lib/ansible/runner/__init__.py
@@ -602,7 +602,7 @@ class Runner(object):
if 'skipped' in data:
self.callbacks.on_skipped(result.host)
elif not result.is_successful():
- ignore_errors = self.module_vars['ignore_errors']
+ ignore_errors = self.module_vars.get('ignore_errors', False)
self.callbacks.on_failed(result.host, data, ignore_errors)
if ignore_errors:
if 'failed' in result.result:
diff --git a/test/TestPlayBook.py b/test/TestPlayBook.py
index 8e5704e7ee..cf13ee3852 100644
--- a/test/TestPlayBook.py
+++ b/test/TestPlayBook.py
@@ -54,8 +54,8 @@ class TestCallbacks(object):
def on_unreachable(self, host, msg):
EVENTS.append([ 'unreachable', [ host, msg ]])
- def on_failed(self, host, results):
- EVENTS.append([ 'failed', [ host, results ]])
+ def on_failed(self, host, results, ignore_errors):
+ EVENTS.append([ 'failed', [ host, results, ignore_errors ]])
def on_ok(self, host, result):
# delete certain info from host_result to make test comparisons easier