From de1d0011bc7072b2176abff463b1bf1c062b0be0 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Tue, 28 Feb 2012 02:32:14 -0500 Subject: [PATCH] Take darkened hosts out of the playbook rotation, fix error handling in template module so that if a directory path is specified we get valid output --- lib/ansible/playbook.py | 2 +- library/template | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) mode change 100644 => 100755 library/template diff --git a/lib/ansible/playbook.py b/lib/ansible/playbook.py index 0c5377d2ff2..33bcb755f79 100755 --- a/lib/ansible/playbook.py +++ b/lib/ansible/playbook.py @@ -111,7 +111,7 @@ class PlayBook(object): # do not continue to run tasks on hosts that have had failures new_hosts = [] for x in host_list: - if not self.failures.has_key(x): + if not self.failures.has_key(x) and not self.dark.has_key(x): new_hosts.append(x) host_list = new_hosts diff --git a/library/template b/library/template old mode 100644 new mode 100755 index fd454df42e6..3850cb152cd --- a/library/template +++ b/library/template @@ -72,6 +72,13 @@ if not os.path.exists(source): source = file(source).read() +if os.path.isdir(dest): + print json.dumps({ + "failed" : 1, + "msg" : "Destination is a directory" + }) + sys.exit(1) + # record md5sum of original source file so we can report if it changed changed = False md5sum = None