Compare commits

...

No commits in common. "c8" and "c8s" have entirely different histories.
c8 ... c8s

12 changed files with 31 additions and 388 deletions

18
.gitignore vendored
View File

@ -1,2 +1,16 @@
SOURCES/sos-4.10.1.tar.gz
SOURCES/sos-audit-0.3-1.tgz
/sos-4.2.tar.gz
/sos-audit-0.3.tgz
/sos-4.3.tar.gz
/sos-4.4.tar.gz
/sos-4.5.0.tar.gz
/sos-4.5.1.tar.gz
/sos-4.5.3.tar.gz
/sos-4.5.4.tar.gz
/sos-4.5.6.tar.gz
/sos-4.6.0.tar.gz
/sos-4.6.1.tar.gz
/sos-4.7.0.tar.gz
/sos-4.7.1.tar.gz
/sos-4.7.2.tar.gz
/sos-4.8.0.tar.gz
/sos-4.8.1.tar.gz

View File

@ -1,2 +0,0 @@
9e592633b8ac40cfd84c08b33d3f213edaadfb08 SOURCES/sos-4.10.1.tar.gz
00752b68ec5e1141192a9dab7d44377b8d637bf7 SOURCES/sos-audit-0.3-1.tgz

View File

@ -1,66 +0,0 @@
--- 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(":"))

View File

@ -1,27 +0,0 @@
--- /dev/null 2025-10-28 14:11:21.494784405 +0100
+++ sos-4.10.1/bin/sosreport 2025-12-04 08:46:53.277857061 +0100
@@ -0,0 +1,5 @@
+#!/bin/bash
+echo "sosreport binary is deprecated, use 'sos report' instead"
+exec sos report "$@"
+
+# vim:ts=4 et sw=4
--- /dev/null 2025-10-28 14:11:21.494784405 +0100
+++ sos-4.10.1/bin/sos-collector 2025-12-04 08:48:04.661880220 +0100
@@ -0,0 +1,5 @@
+#!/bin/bash
+echo "sos-collector binary is deprecated, use 'sos collector' instead"
+exec sos collector "$@"
+
+# vim:ts=4 et sw=4
--- sos-4.10.1/setup.py 2025-04-15 15:17:21.938635468 +0200
+++ sos-4.10.1/setup.py 2025-04-15 15:17:41.328198501 +0200
@@ -34,7 +34,7 @@
maintainer_email='jacob.r.hunsaker@gmail.com',
url='https://github.com/sosreport/sos',
license="GPLv2+",
- scripts=['bin/sos'],
+ scripts=['bin/sos', 'bin/sosreport', 'bin/sos-collector'],
data_files=data_files,
packages=find_packages(include=['sos', 'sos.*'])
)

View File

@ -1,49 +0,0 @@
--- a/sos/upload/targets/__init__.py 2025-09-16 19:57:27.294642506 +0200
+++ b/sos/upload/targets/__init__.py 2025-09-16 19:59:44.498573843 +0200
@@ -465,7 +465,7 @@
self.upload_password or
self._upload_password)
- def upload_sftp(self, user=None, password=None, user_dir=None):
+ def upload_sftp(self, user=None, password=None):
"""Attempts to upload the archive to an SFTP location.
Due to the lack of well maintained, secure, and generally widespread
@@ -540,13 +540,10 @@
raise Exception("Unable to connect via SFTP to "
f"{self.get_upload_url_string()}")
- # certain implementations require file to be put in the user dir
- put_cmd = (
- f"put {self.upload_archive_name} "
- f"{f'{user_dir}/' if user_dir else ''}"
- f"{self._get_sftp_upload_name()}"
- )
+ put_cmd = (f'put {self.upload_archive_name} '
+ f'{self._get_sftp_upload_name()}')
ret.sendline(put_cmd)
+
put_expects = [
'100%',
pexpect.TIMEOUT,
--- a/sos/upload/targets/redhat.py 2025-09-16 19:57:36.804628207 +0200
+++ b/sos/upload/targets/redhat.py 2025-09-16 20:00:52.578728154 +0200
@@ -145,7 +145,7 @@
return fname
# pylint: disable=too-many-branches
- def upload_sftp(self, user=None, password=None, user_dir=None):
+ def upload_sftp(self, user=None, password=None):
"""Override the base upload_sftp to allow for setting an on-demand
generated anonymous login for the RH SFTP server if a username and
password are not given
@@ -217,8 +217,7 @@
f"{anon.status_code}): {anon.json()}"
)
if _user and _token:
- return super().upload_sftp(user=_user, password=_token,
- user_dir=_user)
+ return super().upload_sftp(user=_user, password=_token)
raise Exception("Could not retrieve valid or anonymous credentials")
def check_file_too_big(self, archive):

View File

@ -1,36 +0,0 @@
--- 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)])

View File

@ -1,60 +0,0 @@
From 6402b4240929b334c31a38a9c86e16e0b6a9e4dd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Fern=C3=A1ndez=20Rodr=C3=ADguez?=
<pafernan@redhat.com>
Date: Fri, 21 Nov 2025 12:32:30 +0100
Subject: [PATCH] [pulpcore] RFE export table contents as CSV
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Resolves: #4152
Signed-off-by: Pablo Fernández Rodríguez <pafernan@redhat.com>
---
sos/report/plugins/pulpcore.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/sos/report/plugins/pulpcore.py b/sos/report/plugins/pulpcore.py
index ffd53e01..4b126e78 100644
--- a/sos/report/plugins/pulpcore.py
+++ b/sos/report/plugins/pulpcore.py
@@ -127,14 +127,15 @@ class PulpCore(Plugin, IndependentPlugin):
"AND table_schema = 'public' AND column_name NOT IN"
" ('args', 'kwargs', 'enc_args', 'enc_kwargs'))"
" TO STDOUT;")
- col_out = self.exec_cmd(self.build_query_cmd(_query), env=self.env,
+ col_out = self.exec_cmd(self.build_query_cmd(_query, csv=False),
+ env=self.env,
runas=self.runas,
container=self.in_container)
columns = col_out['output'] if col_out['status'] == 0 else '*'
_query = (f"select {columns} from {table} where pulp_last_updated"
f"> NOW() - interval '{task_days} days' order by"
" pulp_last_updated")
- _cmd = self.build_query_cmd(_query)
+ _cmd = self.build_query_cmd(_query, csv=True)
self.add_cmd_output(_cmd, env=self.env, suggest_filename=table,
runas=self.runas, container=self.in_container)
@@ -152,7 +153,8 @@ class PulpCore(Plugin, IndependentPlugin):
"pg_total_relation_size(reltoastrelid) AS toast_bytes "
"FROM pg_class c LEFT JOIN pg_namespace n ON "
"n.oid = c.relnamespace WHERE relkind = 'r') a) a order by "
- "total_bytes DESC"
+ "total_bytes DESC",
+ csv=False
)
self.add_cmd_output(_cmd, suggest_filename='pulpcore_db_tables_sizes',
env=self.env, runas=self.runas,
@@ -168,7 +170,7 @@ class PulpCore(Plugin, IndependentPlugin):
"""
if csv:
query = f"COPY ({query}) TO STDOUT " \
- "WITH (FORMAT 'csv', DELIMITER ',', HEADER)"
+ "WITH (FORMAT 'csv', DELIMITER ';', HEADER)"
_dbcmd = "psql --no-password -h %s -p %s -U %s -d %s -c %s"
return _dbcmd % (self.dbhost, self.dbport,
self.dbuser, self.dbname, quote(query))
--
2.51.1

View File

@ -1,31 +0,0 @@
From 1c1ee1ac676961fecfc5513fa4f90656401b3aaa Mon Sep 17 00:00:00 2001
From: Pavel Moravec <pmoravec@redhat.com>
Date: Wed, 5 Nov 2025 11:53:57 +0100
Subject: [PATCH] [cleaner] Mask IPv6 addresses with trailing ':' or '\'
Additionally, fix missing backslash in subnet identification.
Resolves: #4154
Closes: #4155
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
---
sos/cleaner/parsers/ipv6_parser.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sos/cleaner/parsers/ipv6_parser.py b/sos/cleaner/parsers/ipv6_parser.py
index bfb860c7..315241f5 100644
--- a/sos/cleaner/parsers/ipv6_parser.py
+++ b/sos/cleaner/parsers/ipv6_parser.py
@@ -27,7 +27,7 @@ class SoSIPv6Parser(SoSCleanerParser):
# a trailing prefix for the network bits.
r"(?<![:\\.\\-a-z0-9])((([0-9a-f]{1,4})(:[0-9a-f]{1,4}){7})|"
r"(([0-9a-f]{1,4}(:[0-9a-f]{0,4}){0,5}))([^.])::(([0-9a-f]{1,4}"
- r"(:[0-9a-f]{1,4}){0,5})?)(/\d{1,3})?)(?![:\\a-z0-9])"
+ r"(:[0-9a-f]{1,4}){0,5})?)(\/\d{1,3})?)(?!([a-z0-9]|:[a-z0-9]))"
]
parser_skip_files = [
'etc/dnsmasq.conf.*',
--
2.51.1

View File

@ -1,58 +0,0 @@
From d78e7000d0c91ba0b6b7a56fc931bce3094d0bc9 Mon Sep 17 00:00:00 2001
From: Frank Liang <xiliang@redhat.com>
Date: Wed, 3 Dec 2025 00:21:06 +0800
Subject: [PATCH] [plugin_aws]fix unable to get metadata in aws.py
- exec_cmd() cmd type is a str, cannot execute when
it is a list
- removed spaces after X-aws-ec2-metadata-token and
X-aws-ec2-metadata-token-ttl-seconds
Signed-off-by: Frank Liang <xiliang@redhat.com>
---
sos/report/plugins/aws.py | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/sos/report/plugins/aws.py b/sos/report/plugins/aws.py
index 602e88e4..ba819bed 100644
--- a/sos/report/plugins/aws.py
+++ b/sos/report/plugins/aws.py
@@ -41,21 +41,19 @@ class Aws(Plugin, IndependentPlugin):
# Try to get an IMDSv2 token
token_url = 'http://169.254.169.254/latest/api/token'
- token_cmd = [
- 'curl', '-sS', '-X', 'PUT', '-H',
- 'X-aws-ec2-metadata-token-ttl-seconds: 21600',
- token_url]
+ token_cmd = f'curl -sS -X PUT -H \
+ X-aws-ec2-metadata-token-ttl-seconds:21600 {token_url}'
try:
- token = self.exec_cmd(token_cmd, timeout=1)
+ token = self.exec_cmd(token_cmd, timeout=1)['output']
except Exception:
token = ''
# Add header only if token retrieval succeeded
- token_header = []
+ token_header = ''
if token:
- token_header = ['-H', f'X-aws-ec2-metadata-token: {token}']
+ token_header = f'-H X-aws-ec2-metadata-token:{token}'
# List of metadata paths we want to get
metadata_paths = [
@@ -73,7 +71,7 @@ class Aws(Plugin, IndependentPlugin):
meta_url = base_url + path
safe_name = path.replace('/', '_')
self.add_cmd_output(
- ['curl', '-sS'] + token_header + [meta_url],
+ f'curl -sS {token_header} {meta_url}',
suggest_filename=f'aws_metadata_{safe_name}.txt'
)
--
2.51.1

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}

View File

@ -1,11 +1,11 @@
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%global auditversion 0.3-1
%global auditversion 0.3
Summary: A set of tools to gather troubleshooting information from a system
Name: sos
Version: 4.10.1
Release: 2%{?dist}
Version: 4.8.1
Release: 1%{?dist}
Group: Applications/System
Source0: https://github.com/sosreport/sos/archive/%{version}/sos-%{version}.tar.gz
Source1: sos-audit-%{auditversion}.tgz
@ -22,13 +22,6 @@ Recommends: python3-pexpect
Recommends: python3-pyyaml
Conflicts: vdsm < 4.40
Obsoletes: sos-collector
Patch1: 0001-python3-walrus-operator.patch
Patch2: 0002-sosreport-binary.patch
Patch3: 0003-revert-PR4092.patch
Patch4: 0004-cleaner-rhel8.patch
Patch5: 0005-pulpcore-RFE-export-table-contents-as-CSV.patch
Patch6: 0006-cleaner-Mask-IPv6-addresses-with-trailing-or.patch
Patch7: 0007-plugin_aws-fix-unable-to-get-metadata-in-aws.py.patch
%description
Sos is a set of tools that gathers information about system
@ -39,13 +32,6 @@ support technicians and developers.
%prep
%setup -qn %{name}-%{version}
%setup -T -D -a1 -q
%patch -P 1 -p1
%patch -P 2 -p1
%patch -P 3 -p1
%patch -P 4 -p1
%patch -P 5 -p1
%patch -P 6 -p1
%patch -P 7 -p1
%build
%py3_build
@ -69,17 +55,18 @@ mkdir -p %{buildroot}%{_sysconfdir}/sos/{cleaner,presets.d,extras.d,groups.d}
# internationalization is currently broken. Uncomment this line once fixed.
# %%files -f %%{name}.lang
%files
%{_sbindir}/sos
%{_sbindir}/sosreport
%{_sbindir}/sos
%{_sbindir}/sos-collector
%dir /etc/sos/presets.d
%dir /etc/sos/extras.d
%dir /etc/sos/groups.d
/etc/tmpfiles.d/%{name}.conf
%{python3_sitelib}/*
%{_mandir}/man1/sosreport.1.gz
%{_mandir}/man1/sos-clean.1.gz
%{_mandir}/man1/sos-upload.1.gz
%{_mandir}/man1/sos-collect.1.gz
%{_mandir}/man1/sos-collector.1.gz
%{_mandir}/man1/sos-help.1.gz
%{_mandir}/man1/sos-mask.1.gz
%{_mandir}/man1/sos-report.1.gz
@ -92,7 +79,7 @@ mkdir -p %{buildroot}%{_sysconfdir}/sos/{cleaner,presets.d,extras.d,groups.d}
%package audit
Summary: Audit use of some commands for support purposes
License: GPL-2.0-or-later
License: GPLv2+
Group: Application/System
%description audit
@ -115,45 +102,8 @@ of the system. Currently storage and filesystem commands are audited.
%{_mandir}/man8/sos-audit.sh.8.gz
%ghost /etc/audit/rules.d/40-sos-filesystem.rules
%ghost /etc/audit/rules.d/40-sos-storage.rules
%license LICENSE
%changelog
* Fri Dec 05 2025 Jan Jansky <jjansky@redhat.com> = 4.10.1-2
- Fixing sosreport and sos-collector binary
Resolves: RHEL-121468
* Tue Nov 25 2025 Jan Jansky <jjansky@redhat.com> = 4.10.1-1
- Update to 4.10.1-1
Resolves: RHEL-121468
* Tue Sep 23 2025 Jan Jansky <jjansky@redhat.com> = 4.10.0-4
- Update to 4.10.0-4
Resolves: RHEL-112413
* Wed Sep 17 2025 Jan Jansky <jjansky@redhat.com> = 4.10.0-2
- Update to 4.10.0-2
Resolves: RHEL-112413
* Thu Aug 21 2025 Jan Jansky <jjansky@redhat.com> = 4.10.0-1
- Update to 4.10.0
Resolves: RHEL-110499
* Fri Jul 04 2025 Jan Jansky <jjansky@redhat.com> = 4.9.2-1
- Update to 4.9.2 in RHEL 8
Resolves: RHEL-101716
* Fri May 30 2025 Jan Jansky <jjansky@redhat.com> = 4.9.1-2
- Update to 4.9.1-2 in RHEL 8
Resolves: RHEL-86645
* Tue Apr 15 2025 Jan Jansky <jjansky@redhat.com> = 4.9.1-1
- Update to 4.9.1 in RHEL 8
Resolves: RHEL-86645
* Tue Jan 07 2025 Jan Jansky <jjansky@redhat.com> = 4.8.2-1
- Update to 4.8.2 in RHEL 8
Resolves: RHEL-72941
* Wed Oct 23 2024 Jan Jansky <jjansky@redhat.com> = 4.8.1-1
- Update to 4.8.1 in RHEL 8
Resolves: RHEL-64160

2
sources Normal file
View File

@ -0,0 +1,2 @@
SHA512 (sos-4.8.1.tar.gz) = c75d5a891c0dd48d2cf511f39dc25a71b65e9daf965d9c1be7ace94f957ec62543fa0c8d1cc700b557920ee581eacce9cf1d8520d5401396aba323dee131e633
SHA512 (sos-audit-0.3.tgz) = 32597baf6350804d08179a0dbe48470a93df148e83d2e49bb3288f6bcc2d151bb1433761913bfbccd912c14de92435939fef5bcd7e091dfe33a345d61ea842ea