--- a/sos/report/plugins/coredump.py +++ b/sos/report/plugins/coredump.py @@ -72,8 +72,8 @@ cdump = line.split() pid = cdump[4] exe = cdump[-2] - if regex := self.get_option("executable"): - if not re.search(regex, exe, re.I): + if self.get_option("executable"): + if not re.search(self.get_option("executable"), exe, re.I): continue cinfo = self.collect_cmd_output(f"coredumpctl info {pid}") if cinfo['status'] != 0: --- a/sos/collector/sosnode.py +++ b/sos/collector/sosnode.py @@ -372,7 +372,8 @@ for line in result.splitlines(): if not is_list: try: - if ls := line.split(): + ls = line.split() + if ls: res.append(ls[0]) except Exception as err: self.log_debug(f"Error parsing sos help: {err}") --- a/sos/report/plugins/mongodb.py +++ b/sos/report/plugins/mongodb.py @@ -87,9 +87,11 @@ ) def setup(self): - if get_juju_info := self.path_exists('/var/lib/juju/db'): + if self.path_exists('/var/lib/juju/db'): + get_juju_info = self.path_exists('/var/lib/juju/db') self.db_folder = "/var/lib/juju/db" - elif get_juju_info := self.path_exists('/var/snap/juju-db/curent/db'): + elif self.path_exists('/var/snap/juju-db/curent/db'): + get_juju_info = self.path_exists('/var/snap/juju-db/curent/db') self.db_folder = "/var/snap/juju-db/current/db" super().setup() --- a/sos/report/plugins/loki.py 2025-11-24 11:20:56.237814760 +0100 +++ b/sos/report/plugins/loki.py 2025-11-24 11:28:37.466603011 +0100 @@ -143,7 +143,8 @@ if self.get_option("collect-logs"): endpoint = self.get_option("endpoint") or "http://localhost:3100" self.labels = [] - if labels_option := self.get_option("labels"): + labels_option = self.get_option("labels") + if labels_option: if isinstance(labels_option, str) and labels_option: self.labels.extend(labels_option.split(":")) --- a/sos/cleaner/archives/__init__.py 2025-09-22 19:44:51.272619200 +0200 +++ b/sos/cleaner/archives/__init__.py 2025-09-22 23:28:15.116001268 +0200 @@ -118,6 +118,8 @@ class SoSObfuscationArchive(): self.parsers = parsers # TODO: include this in __init__? def load_parser_entries(self): + self.soslog = logging.getLogger('sos') + self.ui_log = logging.getLogger('sos_ui') for parser in self.parsers: parser.load_map_entries() @@ -150,6 +152,7 @@ class SoSObfuscationArchive(): return line, count def obfuscate_arc_files(self, flist): + self.load_parser_entries() for filename in flist: self.log_debug(f" pid={os.getpid()}: obfuscating {filename}") try: --- a/sos/cleaner/__init__.py 2025-09-22 19:44:51.272619200 +0200 +++ b/sos/cleaner/__init__.py 2025-09-22 23:32:17.606745778 +0200 @@ -720,10 +720,11 @@ third party. # based on files' sizes. files_obfuscated_count = total_sub_count = removed_file_count = 0 + # two nullification required before processes cloning + archive.soslog = None + archive.ui_log = None archive_list = [archive for i in range(self.opts.jobs)] - with ProcessPoolExecutor( - max_workers=self.opts.jobs, - initializer=archive.load_parser_entries) as executor: + with ProcessPoolExecutor(max_workers=self.opts.jobs) as executor: futures = executor.map(obfuscate_arc_files, archive_list, [file_list[i::self.opts.jobs] for i in range(self.opts.jobs)]) --- a/sos/collector/sosnode.py 2026-04-02 10:15:34.743009569 +0200 +++ b/sos/collector/sosnode.py 2026-04-02 10:17:42.557250748 +0200 @@ -163,7 +163,8 @@ if not self._sudo_binary: _bin = self.opts.sudo_binary.split('/')[-1] # verify the provided binary is at least in our PATH - if ret := self.run_command(f"command -v {_bin}"): + ret = self.run_command(f"command -v {_bin}") + if ret: if not ret['status'] == 0: err = f"Privilege escalation command not in PATH: {_bin}" self.log_error(err) --- a/sos/report/plugins/logs.py 2026-04-02 10:19:59.641196712 +0200 +++ b/sos/report/plugins/logs.py 2026-04-02 10:20:28.313299348 +0200 @@ -38,7 +38,8 @@ # this WILL break on anything other than basic echos # as shown in the rsyslog documentation if _ent.startswith('echo '): - if envc := os.getenv(_ent.split()[1].strip(' $`')): + envc = os.getenv(_ent.split()[1].strip(' $`')) + if envc: confs += glob.glob(envc) else: confs += glob.glob(_ent)