summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/runtime
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2023-09-23 14:04:07 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-09-26 10:23:32 +0100
commit03bb14cebf5879472a8da78d892ecd5c5df5c3cf (patch)
tree5083c194f292ca1fb8806f77fd051b7121fd919b /meta/lib/oeqa/runtime
parentf8f8f2f697c53b1cc19326249e15bf0d864f0a05 (diff)
downloadopenembedded-core-contrib-03bb14cebf5879472a8da78d892ecd5c5df5c3cf.tar.gz
oeqa/runtime/parselogs: improve find call
getLogList() uses remote find invocations to find the logs. Instead of relying on shell expansion of wildcards and redundant use of -maxdepth (pointless as the shell expansion means the find is passed the files to return), invoke find idiomatically by telling it what directory to search for and escape the glob so find processes it. Also remove many pointless str() calls. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/runtime')
-rw-r--r--meta/lib/oeqa/runtime/cases/parselogs.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/meta/lib/oeqa/runtime/cases/parselogs.py b/meta/lib/oeqa/runtime/cases/parselogs.py
index 6e5dc75306..93782b844b 100644
--- a/meta/lib/oeqa/runtime/cases/parselogs.py
+++ b/meta/lib/oeqa/runtime/cases/parselogs.py
@@ -229,18 +229,18 @@ class ParseLogsTest(OERuntimeTestCase):
def getLogList(self, log_locations):
logs = []
for location in log_locations:
- status, _ = self.target.run('test -f ' + str(location))
+ status, _ = self.target.run('test -f %s' % location)
if status == 0:
- logs.append(str(location))
+ logs.append(location)
else:
- status, _ = self.target.run('test -d ' + str(location))
+ status, _ = self.target.run('test -d %s' % location)
if status == 0:
- cmd = 'find ' + str(location) + '/*.log -maxdepth 1 -type f'
+ cmd = 'find %s -name \\*.log -maxdepth 1 -type f' % location
status, output = self.target.run(cmd)
if status == 0:
output = output.splitlines()
for logfile in output:
- logs.append(os.path.join(location, str(logfile)))
+ logs.append(os.path.join(location, logfile))
return logs
# Copy the log files to be parsed locally