From fa00c69ff2c360b0e193f2f0839609374e66126e Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Mon, 2 May 2016 11:29:04 -0700 Subject: [PATCH] bytearray isn't available in python2.4 (#3583) * Detection of handler depends on the wrong handler failing to list the contents of the tarfile. Use explicit compression types with the python tarfile library to achieve that. * bytearray isn't available in python2.4 --- lib/ansible/modules/files/unarchive.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/files/unarchive.py b/lib/ansible/modules/files/unarchive.py index 1727c9cbd6..d9e8aa9cce 100644 --- a/lib/ansible/modules/files/unarchive.py +++ b/lib/ansible/modules/files/unarchive.py @@ -345,7 +345,7 @@ class ZipArchive(object): diff += 'c%s++++++.?? %s\n' % (ftype, path) continue - itemized = bytearray('.%s.......??' % ftype) + itemized = list('.%s.......??' % ftype) dt_object = datetime.datetime(*(time.strptime(pcs[6], '%Y%m%d.%H%M%S')[0:6])) timestamp = time.mktime(dt_object.timetuple()) @@ -444,7 +444,7 @@ class ZipArchive(object): if change: if path not in self.includes: self.includes.append(path) - diff += '%s %s\n' % (itemized, path) + diff += '%s %s\n' % (''.join(itemized), path) if self.includes: unarchived = False