fixes for tests

This commit is contained in:
Petros Moisiadis 2012-08-01 22:17:16 +03:00
parent 5f4bf813b1
commit 2ac4acbf97
3 changed files with 6 additions and 6 deletions

View file

@ -147,7 +147,7 @@ class DefaultRunnerCallbacks(object):
def __init__(self): def __init__(self):
pass pass
def on_failed(self, host, res): def on_failed(self, host, res, ignore_errors=False):
pass pass
def on_ok(self, host, res): def on_ok(self, host, res):
@ -185,7 +185,7 @@ class CliRunnerCallbacks(DefaultRunnerCallbacks):
self.options = None self.options = None
self._async_notified = {} self._async_notified = {}
def on_failed(self, host, res): def on_failed(self, host, res, ignore_errors=False):
self._on_any(host,res) self._on_any(host,res)
@ -259,7 +259,7 @@ class PlaybookRunnerCallbacks(DefaultRunnerCallbacks):
else: else:
print "fatal: [%s] => %s" % (host, msg) 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) item = results.get('item', None)

View file

@ -602,7 +602,7 @@ class Runner(object):
if 'skipped' in data: if 'skipped' in data:
self.callbacks.on_skipped(result.host) self.callbacks.on_skipped(result.host)
elif not result.is_successful(): 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) self.callbacks.on_failed(result.host, data, ignore_errors)
if ignore_errors: if ignore_errors:
if 'failed' in result.result: if 'failed' in result.result:

View file

@ -54,8 +54,8 @@ class TestCallbacks(object):
def on_unreachable(self, host, msg): def on_unreachable(self, host, msg):
EVENTS.append([ 'unreachable', [ host, msg ]]) EVENTS.append([ 'unreachable', [ host, msg ]])
def on_failed(self, host, results): def on_failed(self, host, results, ignore_errors):
EVENTS.append([ 'failed', [ host, results ]]) EVENTS.append([ 'failed', [ host, results, ignore_errors ]])
def on_ok(self, host, result): def on_ok(self, host, result):
# delete certain info from host_result to make test comparisons easier # delete certain info from host_result to make test comparisons easier