BmapCopy: fix tar.gz compression support
authorArtem Bityutskiy <artem.bityutskiy@intel.com>
Tue, 27 Nov 2012 12:39:40 +0000 (14:39 +0200)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Tue, 27 Nov 2012 12:40:49 +0000 (14:40 +0200)
This is a nasty bug - I used 'if' instead of 'elif' ... Thanks to
'test_api_base' for revealing it.

Change-Id: I43e1954cb02c46ac27e9d9e7324e86ef9dec2974
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
bmaptools/BmapCopy.py

index c362b62..3d2b627 100644 (file)
@@ -189,7 +189,7 @@ class BmapCopy:
                     raise Error("the image tarball '%s' is empty (no files)" \
                                 % self._image_path)
                 self._f_image = tar.extractfile(members[0])
-            if self._image_path.endswith('.gz'):
+            elif self._image_path.endswith('.gz'):
                 import gzip
                 self._f_image = gzip.GzipFile(self._image_path, 'rb')
             elif self._image_path.endswith('.bz2'):