From 0a818afaac6586666220bdcabcc63257b3cf3ede Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Thu, 19 Nov 2020 15:42:14 +0100 Subject: [PATCH] Fix collectl plugin We can't subscript filter objects. --- lib/galaxy/job_metrics/instrumenters/collectl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/job_metrics/instrumenters/collectl.py b/lib/galaxy/job_metrics/instrumenters/collectl.py index 439031b266b..0ce2760bdb1 100644 --- a/lib/galaxy/job_metrics/instrumenters/collectl.py +++ b/lib/galaxy/job_metrics/instrumenters/collectl.py @@ -99,9 +99,9 @@ class CollectlPlugin(InstrumentPlugin): pid = open(self.__pid_file(job_directory)).read().strip() contents = os.listdir(job_directory) try: - rel_path = filter(self._is_instrumented_collectl_log, contents)[0] + rel_path = next(iter(filter(self._is_instrumented_collectl_log, contents))) path = os.path.join(job_directory, rel_path) - except IndexError: + except StopIteration: message = "Failed to find collectl log in directory {}, files were {}".format(job_directory, contents) raise Exception(message)