From bb6421b339e114d27ca82f6c177e3a38b5a1ecce Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Tue, 28 Apr 2015 10:29:47 +0100 Subject: [PATCH] Fixing file_exists on linux devices. --- wlauto/common/linux/device.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wlauto/common/linux/device.py b/wlauto/common/linux/device.py index 1665f82c..f8b5ee43 100644 --- a/wlauto/common/linux/device.py +++ b/wlauto/common/linux/device.py @@ -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)