From c7957aeeb520c51e1ffb335462208b6e7519726c Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Sat, 23 Sep 2023 14:04:07 +0100 Subject: 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. (From OE-Core rev: 03bb14cebf5879472a8da78d892ecd5c5df5c3cf) Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- meta/lib/oeqa/runtime/cases/parselogs.py | 10 +++++----- 1 file 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 -- cgit v1.2.3-54-g00ecf