From fffd40f15bbacd9636679444e5c4a01b5067b2e5 Mon Sep 17 00:00:00 2001 From: "wu.chunyang" Date: Mon, 23 Nov 2020 20:01:21 +0800 Subject: [PATCH] Fix an Ansible warning set_available_variables is being deprecated. Use "@available_variables.setter" instead. Refer to: https://fossies.org/linux/ansible/lib/ansible/template/__init__.py Change-Id: I874318f78043d21d2aeebe4e0c35a304b5c94029 --- ansible/action_plugins/merge_yaml.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/action_plugins/merge_yaml.py b/ansible/action_plugins/merge_yaml.py index 90ed82b76f..9295766938 100755 --- a/ansible/action_plugins/merge_yaml.py +++ b/ansible/action_plugins/merge_yaml.py @@ -118,7 +118,7 @@ class ActionModule(action.ActionBase): temp_vars = task_vars.copy() temp_vars.update(extra_vars) - self._templar.set_available_variables(temp_vars) + self._templar.available_variables = temp_vars output = {} sources = self._task.args.get('sources', None) @@ -130,7 +130,7 @@ class ActionModule(action.ActionBase): output, self.read_config(source), extend_lists) # restore original vars - self._templar.set_available_variables(old_vars) + self._templar.available_variables = old_vars local_tempdir = tempfile.mkdtemp(dir=constants.DEFAULT_LOCAL_TMP)