From ac6a434db78183cffab680e3389b761605268c45 Mon Sep 17 00:00:00 2001 From: Hofi Date: Thu, 26 Sep 2024 13:59:04 +0200 Subject: [PATCH] s3: use python3.9 compatible glob() https://github.com/syslog-ng/syslog-ng/issues/5131 Signed-off-by: Hofi --- modules/python-modules/syslogng/modules/s3/s3_destination.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/python-modules/syslogng/modules/s3/s3_destination.py b/modules/python-modules/syslogng/modules/s3/s3_destination.py index 853f0d1bd5..7f94c475d7 100644 --- a/modules/python-modules/syslogng/modules/s3/s3_destination.py +++ b/modules/python-modules/syslogng/modules/s3/s3_destination.py @@ -32,7 +32,6 @@ deps_installed = False from concurrent.futures import ThreadPoolExecutor -from glob import glob from logging import getLogger from pathlib import Path from signal import signal, SIGINT, SIG_IGN @@ -182,8 +181,7 @@ def generate_persist_name(options: Dict[str, Any]) -> str: return f"s3({','.join([options['url'], options['bucket'], str(options['object_key'])])})" def __load_persist(self) -> None: - for path_str in glob(pathname="*.json", root_dir=self.working_dir): - path = Path(self.working_dir, path_str) + for path in Path(self.working_dir).glob("*.json"): try: persist = S3ObjectPersist.load(path=path) except PersistLoadError: