1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix checksum code to work with delegate_to/local_action

Fixes #9704
This commit is contained in:
Toshio Kuratomi 2014-12-03 14:42:01 -08:00
parent 0c65aa287c
commit a2b2e54992

View file

@ -1223,7 +1223,10 @@ class Runner(object):
def _remote_checksum(self, conn, tmp, path, inject):
''' takes a remote checksum and returns 1 if no file '''
python_interp = inject['hostvars'][inject['inventory_hostname']].get('ansible_python_interpreter', 'python')
if 'delegate_to' in inject and inject['delegate_to']:
python_interp = inject['hostvars'][inject['delegate_to']].get('ansible_python_interpreter', 'python')
else:
python_interp = inject['hostvars'][inject['inventory_hostname']].get('ansible_python_interpreter', 'python')
cmd = conn.shell.checksum(path, python_interp)
data = self._low_level_exec_command(conn, cmd, tmp, sudoable=True)
data2 = utils.last_non_blank_line(data['stdout'])