1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-06 02:41:11 +01:00

Fixing file_exists on linux devices.

This commit is contained in:
Sergei Trofimov 2015-04-28 10:29:47 +01:00
parent 50c8c4da34
commit bb6421b339

View File

@ -937,7 +937,9 @@ class LinuxDevice(BaseLinuxDevice):
def file_exists(self, filepath):
output = self.execute('if [ -e \'{}\' ]; then echo 1; else echo 0; fi'.format(filepath))
return boolean(output.strip()) # pylint: disable=maybe-no-member
# output from ssh my contain part of the expression in the buffer,
# split out everything except the last word.
return boolean(output.split()[-1]) # pylint: disable=maybe-no-member
def listdir(self, path, as_root=False, **kwargs):
contents = self.execute('ls -1 {}'.format(path), as_root=as_root)