issue #61: unused variable (reported by LGTM)

This commit is contained in:
David Wilson 2019-01-20 19:35:49 +00:00
parent bcc7bb7128
commit b8ca015b83
1 changed files with 2 additions and 4 deletions

View File

@ -205,15 +205,13 @@ class ScriptPlanner(BinaryPlanner):
involved here, the vanilla implementation uses it and that use is
exploited in common playbooks.
"""
try:
key = u'ansible_%s_interpreter' % os.path.basename(path).strip()
try:
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(