Commit b44ae0af by Michael DeHaan

applying indentation patch from skvidal

parent a5039eec
......@@ -101,7 +101,7 @@ class PlayBook(object):
'''
if host_list is None:
host_list = self.host_list
host_list = self.host_list
return ansible.runner.Runner(
pattern=pattern,
......@@ -122,7 +122,7 @@ class PlayBook(object):
'''
if host_list is None:
host_list = self.host_list
host_list = self.host_list
instructions = task['do']
(comment, module_details) = instructions
......@@ -161,10 +161,10 @@ class PlayBook(object):
self.processed[host] = 1
failed = False
if module_name == "command":
if results.get("rc", 0) != 0:
failed=True
if results.get("rc", 0) != 0:
failed=True
elif results.get("failed", 0) == 1:
failed=True
failed=True
if failed:
if self.verbose:
......@@ -191,9 +191,9 @@ class PlayBook(object):
subtasks = task.get('notify', [])
if len(subtasks) > 0:
for host, results in contacted.items():
if results.get('changed', False):
for subtask in subtasks:
self._flag_handler(handlers, subtask, host)
if results.get('changed', False):
for subtask in subtasks:
self._flag_handler(handlers, subtask, host)
# TODO: if a host fails in any task, remove it from
# the host list immediately
......@@ -208,9 +208,9 @@ class PlayBook(object):
attribs = x["do"]
name = attribs[0]
if match_name == name:
if not x.has_key("run"):
x['run'] = []
x['run'].append(host)
if not x.has_key("run"):
x['run'] = []
x['run'].append(host)
def _run_pattern(self, pg):
'''
......
#!/usr/bin/python
try:
import json
import json
except ImportError:
import simplejson as json
import simplejson as json
import subprocess
import sys
......
......@@ -4,9 +4,9 @@ import sys
import os
try:
import json
import json
except ImportError:
import simplejson as json
import simplejson as json
source = sys.argv[1]
dest = sys.argv[2]
......@@ -22,14 +22,14 @@ if not os.path.exists(source):
md5sum = None
changed = False
if os.path.exists(dest):
md5sum = os.popen("md5sum %s" % dest).read()
md5sum = os.popen("md5sum %s" % dest).read()
os.system("cp %s %s" % (source, dest))
md5sum2 = os.popen("md5sum %s" % dest).read()
if md5sum != md5sum2:
changed = True
changed = True
# mission accomplished
print json.dumps({
......
......@@ -3,9 +3,9 @@
# requires 'ohai' to be installed
try:
import json
import json
except ImportError:
import simplejson as json
import simplejson as json
import subprocess
......
#!/usr/bin/python
try:
import json
import json
except ImportError:
import simplejson as json
import simplejson as json
print json.dumps(1)
......@@ -4,9 +4,9 @@ import sys
import os
import jinja2
try:
import json
import json
except ImportError:
import simplejson as json
import simplejson as json
source = sys.argv[1]
dest = sys.argv[2]
......@@ -45,7 +45,7 @@ source = file(source).read()
changed = False
md5sum = None
if os.path.exists(dest):
md5sum = os.popen("md5sum %s" % dest).read()
md5sum = os.popen("md5sum %s" % dest).read()
# call Jinja2 here and save the new template file
template = jinja2.Template(source)
......@@ -61,7 +61,7 @@ f.close()
md5sum2 = os.popen("md5sum %s" % dest).read()
if md5sum != md5sum2:
changed = True
changed = True
# mission accomplished
print json.dumps({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment