Add unit tests for playbooks, and fix an error caught by one

This commit is contained in:
Michael DeHaan 2012-03-18 18:29:11 -04:00
parent 9c5ec886a6
commit 45abe3c16b
4 changed files with 159 additions and 2 deletions

View file

@ -83,6 +83,7 @@ class PlayBook(object):
# playbook file can be passed in as a path or
# as file contents (to support API usage)
print "DEBUG: playbook=%s" % playbook
self.basedir = os.path.dirname(playbook)
self.playbook = self._parse_playbook(playbook)
@ -471,7 +472,7 @@ class PlayBook(object):
for (host, host_result) in contacted_hosts.iteritems():
if 'failed' in host_result:
self.callbacks.on_failed(host, host_result)
self.failed[host] = 1
self.failures[host] = 1
# now for each result, load into the setup cache so we can
# let runner template out future commands