=== modified file 'lava_dispatcher/client/master.py'
@@ -20,13 +20,14 @@
# with this program; if not, see <http://www.gnu.org/licenses>.
import contextlib
+import logging
import os
import pexpect
import shutil
-import traceback
+import subprocess
from tempfile import mkdtemp
-import logging
import time
+import traceback
from lava_dispatcher.utils import (
download,
@@ -261,6 +262,19 @@
def master_str(self):
return self.device_option("MASTER_STR")
+ def decompress(self, image_file):
+ for suffix, command in [('.gz', 'gunzip'),
+ ('.xz', 'unxz'),
+ ('.bz2', 'bunzip2')]:
+ if image_file.endswith(suffix):
+ logging.info("Uncompressing %s with %s", image_file, command)
+ uncompressed_name = image_file[:-len(suffix)]
+ subprocess.check_call(
+ [command, '-c', image_file], stdout=open(uncompressed_name, 'w'))
+ return uncompressed_name
+ return image_file
+
+
def deploy_linaro(self, hwpack=None, rootfs=None, image=None,
kernel_matrix=None, use_cache=True, rootfstype='ext3'):
LAVA_IMAGE_TMPDIR = self.context.lava_image_tmpdir
@@ -283,6 +297,7 @@
image_file = download_with_cache(image, tarball_dir, lava_cachedir)
else:
image_file = download(image, tarball_dir)
+ image_file = self.decompress(image_file)
boot_tgz, root_tgz = self._generate_tarballs(image_file)
except CriticalError:
raise
=== modified file 'lava_dispatcher/utils.py'
@@ -86,7 +86,7 @@
splitter.whitespace = ","
splitter.whitespace_split = True
newlines_to_spaces = lambda x: x.replace('\n', ' ')
- strip_newlines = lambda x: newlines_to_spaces(x).strip(' ')
+ strip_newlines = lambda x: newlines_to_spaces(x).strip(' ')
return map(strip_newlines, list(splitter))
def logging_system(cmd):