sos/0001-python3-walrus-operator.patch
Jan Jansky 94724c927d Update to 4.10.1-1
Resolves: RHEL-121468

Signed-off-by: Jan Jansky <jjansky@redhat.com>
2025-11-25 09:51:02 +01:00

67 lines
2.8 KiB
Diff

--- 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/__init__.py 2025-08-21 12:41:10.418390705 +0200
+++ b/sos/report/plugins/__init__.py 2025-08-21 12:55:39.546634618 +0200
@@ -2965,8 +2965,9 @@
:rtype: ``str``
"""
if self.container_exists(container, runtime) or \
- ((_runtime := self._get_container_runtime(runtime)) and
+ ((self._get_container_runtime(runtime)) and
runas is not None):
+ _runtime = self._get_container_runtime(runtime)
return _runtime.fmt_container_cmd(container, cmd, quotecmd)
return ''
--- 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(":"))