diff --git a/wlauto/common/linux/device.py b/wlauto/common/linux/device.py index b1364559..435aa956 100644 --- a/wlauto/common/linux/device.py +++ b/wlauto/common/linux/device.py @@ -189,6 +189,18 @@ class BaseLinuxDevice(Device): # pylint: disable=abstract-method else: self.busybox = 'busybox' + def is_file(self, filepath): + output = self.execute('if [ -f \'{}\' ]; then echo 1; else echo 0; fi'.format(filepath)) + # 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 is_directory(self, filepath): + output = self.execute('if [ -d \'{}\' ]; then echo 1; else echo 0; fi'.format(filepath)) + # 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 get_properties(self, context): for propfile in self.property_files: try: @@ -726,18 +738,6 @@ class LinuxDevice(BaseLinuxDevice): # split out everything except the last word. return boolean(output.split()[-1]) # pylint: disable=maybe-no-member - def is_file(self, filepath): - output = self.execute('if [ -f \'{}\' ]; then echo 1; else echo 0; fi'.format(filepath)) - # 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 is_directory(self, filepath): - output = self.execute('if [ -d \'{}\' ]; then echo 1; else echo 0; fi'.format(filepath)) - # 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).strip() if not contents: