1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-20 20:09:11 +00:00

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).
This commit is contained in:
Sebastian Goscik 2016-03-24 16:28:19 +00:00
parent 5abeb7aac2
commit a2257fe1e2

View File

@ -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: