From be499d3d500d99c075b90b891bf47208f69f6515 Mon Sep 17 00:00:00 2001 From: Trishna Guha Date: Mon, 1 Jul 2019 21:42:33 +0530 Subject: [PATCH] fix src returning None if file is missing or invalid Signed-off-by: Trishna Guha --- action_plugins/command_parser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/action_plugins/command_parser.py b/action_plugins/command_parser.py index 868d124..500fca8 100644 --- a/action_plugins/command_parser.py +++ b/action_plugins/command_parser.py @@ -93,10 +93,10 @@ def run(self, tmp=None, task_vars=None): self.template = template_loader.get('json_template', self._templar) paths = self._task.get_search_path() - for src in sources: - src = generate_source_path(paths, src) + for source in sources: + src = generate_source_path(paths, source) if src is None: - raise AnsibleError("src [%s] is either missing or invalid" % src) + raise AnsibleError("src [%s] is either missing or invalid" % os.path.expanduser(source)) tasks = self._loader.load_from_file(src)