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

unarchive: do not assume tar supports -C

Fixes #7777
(But don't rewrite the tar invocation in is_unarchived(), since a
tar that supports "--diff" certainly supports "-C" as well).
This commit is contained in:
Todd Owen 2014-06-15 22:38:41 +08:00
parent 3fb3e7e6dc
commit 43c9edad8a

View file

@ -120,8 +120,8 @@ class TgzFile(object):
return dict(unarchived=unarchived, rc=rc, out=out, err=err, cmd=cmd)
def unarchive(self):
cmd = '%s -C "%s" -x%sf "%s"' % (self.cmd_path, self.dest, self.zipflag, self.src)
rc, out, err = self.module.run_command(cmd)
cmd = '%s -x%sf "%s"' % (self.cmd_path, self.zipflag, self.src)
rc, out, err = self.module.run_command(cmd, cwd=self.dest)
return dict(cmd=cmd, rc=rc, out=out, err=err)
def can_handle_archive(self):