Commit 1c21fc48 by Michael DeHaan

Merge pull request #3606 from stoned/fix-3521-2

Quote pathnames of roles' tasks and handlers files so that _load_tasks()...
parents 0f264392 e7a733a6
...@@ -21,6 +21,7 @@ from ansible.utils.template import template ...@@ -21,6 +21,7 @@ from ansible.utils.template import template
from ansible import utils from ansible import utils
from ansible import errors from ansible import errors
from ansible.playbook.task import Task from ansible.playbook.task import Task
import pipes
import shlex import shlex
import os import os
...@@ -185,13 +186,13 @@ class Play(object): ...@@ -185,13 +186,13 @@ class Play(object):
if not os.path.isfile(task) and not os.path.isfile(handler) and not os.path.isfile(vars_file) and not os.path.isdir(library): if not os.path.isfile(task) and not os.path.isfile(handler) and not os.path.isfile(vars_file) and not os.path.isdir(library):
raise errors.AnsibleError("found role at %s, but cannot find %s or %s or %s or %s" % (path, task, handler, vars_file, library)) raise errors.AnsibleError("found role at %s, but cannot find %s or %s or %s or %s" % (path, task, handler, vars_file, library))
if os.path.isfile(task): if os.path.isfile(task):
nt = dict(include=task, vars=has_dict) nt = dict(include=pipes.quote(task), vars=has_dict)
for k in special_keys: for k in special_keys:
if k in special_vars: if k in special_vars:
nt[k] = special_vars[k] nt[k] = special_vars[k]
new_tasks.append(nt) new_tasks.append(nt)
if os.path.isfile(handler): if os.path.isfile(handler):
nt = dict(include=handler, vars=has_dict) nt = dict(include=pipes.quote(handler), vars=has_dict)
for k in special_keys: for k in special_keys:
if k in special_vars: if k in special_vars:
nt[k] = special_vars[k] nt[k] = special_vars[k]
......
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