From 82779890391385f5f4f3bd3a84798ab02b4b75be Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Thu, 5 Apr 2018 11:29:01 -0500 Subject: [PATCH] Backport #38194 for 2.5 - include_vars error fix (#38225) * Don't pass keyword args as positional, include file_name. Fixes #38190 (#38194) (cherry picked from commit ddf937d642729b429e2e001b96dc27875429904b) * Add changelog for #38194 --- changelogs/fragments/include_vars_error_hang_fix.yaml | 2 ++ lib/ansible/plugins/action/include_vars.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/include_vars_error_hang_fix.yaml diff --git a/changelogs/fragments/include_vars_error_hang_fix.yaml b/changelogs/fragments/include_vars_error_hang_fix.yaml new file mode 100644 index 0000000000..ec129495f6 --- /dev/null +++ b/changelogs/fragments/include_vars_error_hang_fix.yaml @@ -0,0 +1,2 @@ +bugfixes: +- include_vars - Call DataLoader.load with the correct signature to prevent hang on error processing (https://github.com/ansible/ansible/pull/38194) diff --git a/lib/ansible/plugins/action/include_vars.py b/lib/ansible/plugins/action/include_vars.py index 7ef24e9b3a..8897f87af1 100644 --- a/lib/ansible/plugins/action/include_vars.py +++ b/lib/ansible/plugins/action/include_vars.py @@ -236,7 +236,7 @@ class ActionModule(ActionBase): data = to_text(b_data, errors='surrogate_or_strict') self.show_content = show_content - data = self._loader.load(data, show_content) + data = self._loader.load(data, file_name=filename, show_content=show_content) if not data: data = dict() if not isinstance(data, dict):