Commit 6a7aac38 by Michael DeHaan

misc cleanup in the runner module, splitting some things out into utils,…

misc cleanup in the runner module, splitting some things out into utils, breaking up functions into smaller functions.
parent fef73393
......@@ -295,7 +295,7 @@ class PlayBook(object):
remote_user=remote_user,
setup_cache=SETUP_CACHE,
basedir=self.basedir,
conditionally_execute_if=only_if
conditional=only_if
)
if async_seconds == 0:
......
......@@ -272,6 +272,9 @@ def template(text, vars):
template = jinja2.Template(text)
return template.render(vars)
def double_template(text, vars):
return template(template(text, vars), vars)
def template_from_file(path, vars):
''' run a file through the templating engine '''
data = file(path).read()
......@@ -287,4 +290,12 @@ def parse_yaml_from_file(path):
raise errors.AnsibleError("file not found: %s" % path)
return parse_yaml(data)
def parse_kv(args):
''' convert a string of key/value items to a dict '''
options = {}
for x in args:
if x.find("=") != -1:
k, v = x.split("=")
options[k]=v
return options
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