From a2257fe1e2d0bc47ab590f1049781244419fc571 Mon Sep 17 00:00:00 2001 From: Sebastian Goscik Date: Thu, 24 Mar 2016 16:28:19 +0000 Subject: [PATCH] BaseLinuxDevice: gzipped property files are now zcat'ed Before they were cat'ed this gave garbage output for compressed files. Cat-ing is necessary since not all properties are normal files (sysfs). --- wlauto/common/linux/device.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wlauto/common/linux/device.py b/wlauto/common/linux/device.py index 10581be1..38ae38af 100644 --- a/wlauto/common/linux/device.py +++ b/wlauto/common/linux/device.py @@ -214,7 +214,10 @@ class BaseLinuxDevice(Device): # pylint: disable=abstract-method outfile = os.path.join(context.host_working_directory, normname) if self.is_file(propfile): with open(outfile, 'w') as wfh: - wfh.write(self.execute('cat {}'.format(propfile))) + if propfile.endswith(".gz"): + wfh.write(self.execute('{} zcat {}'.format(self.busybox, propfile))) + else: + wfh.write(self.execute('cat {}'.format(propfile))) elif self.is_directory(propfile): self.pull_file(propfile, outfile) else: