mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Fix unarchive failures when the destination is a symlink to a directory (#15999)
Also add integration tests for this problem and unicode filenames inside a tarball. Fixes #3725
This commit is contained in:
@@ -428,7 +428,7 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
||||
|
||||
return mystat['stat']
|
||||
|
||||
def _remote_checksum(self, path, all_vars):
|
||||
def _remote_checksum(self, path, all_vars, follow=False):
|
||||
'''
|
||||
Produces a remote checksum given a path,
|
||||
Returns a number 0-4 for specific errors instead of checksum, also ensures it is different
|
||||
@@ -440,7 +440,7 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
||||
'''
|
||||
x = "0" # unknown error has occured
|
||||
try:
|
||||
remote_stat = self._execute_remote_stat(path, all_vars, follow=False)
|
||||
remote_stat = self._execute_remote_stat(path, all_vars, follow=follow)
|
||||
if remote_stat['exists'] and remote_stat['isdir']:
|
||||
x = "3" # its a directory not a file
|
||||
else:
|
||||
|
||||
@@ -71,7 +71,7 @@ class ActionModule(ActionBase):
|
||||
else:
|
||||
source = self._loader.path_dwim_relative(self._loader.get_basedir(), 'files', source)
|
||||
|
||||
remote_checksum = self._remote_checksum(dest, all_vars=task_vars)
|
||||
remote_checksum = self._remote_checksum(dest, all_vars=task_vars, follow=True)
|
||||
if remote_checksum == '4':
|
||||
result['failed'] = True
|
||||
result['msg'] = "python isn't present on the system. Unable to compute checksum"
|
||||
|
||||
Reference in New Issue
Block a user