From b8ca015b83826f295c639a9832429eae7d89179a Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sun, 20 Jan 2019 19:35:49 +0000 Subject: [PATCH] issue #61: unused variable (reported by LGTM) --- ansible_mitogen/planner.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ansible_mitogen/planner.py b/ansible_mitogen/planner.py index a58f39b7..03e7ecdf 100644 --- a/ansible_mitogen/planner.py +++ b/ansible_mitogen/planner.py @@ -205,15 +205,13 @@ class ScriptPlanner(BinaryPlanner): involved here, the vanilla implementation uses it and that use is exploited in common playbooks. """ + key = u'ansible_%s_interpreter' % os.path.basename(path).strip() try: - key = u'ansible_%s_interpreter' % os.path.basename(path).strip() template = self._inv.task_vars[key] except KeyError: return path - return mitogen.utils.cast( - self._inv.templar.template(self._inv.task_vars[key]) - ) + return mitogen.utils.cast(self._inv.templar.template(template)) def _get_interpreter(self): path, arg = ansible_mitogen.parsing.parse_hashbang(