Update to 4.10.1-2

Resolves: RHEL-121464

Signed-off-by: Jan Jansky <jjansky@redhat.com>
This commit is contained in:
Jan Jansky 2025-12-04 14:39:53 +01:00
parent a4c51d8d01
commit 5a4f609d09
2 changed files with 65 additions and 1 deletions

View File

@ -0,0 +1,58 @@
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

View File

@ -5,7 +5,7 @@
Summary: A set of tools to gather troubleshooting information from a system
Name: sos
Version: 4.10.1
Release: 1%{?dist}
Release: 2%{?dist}
Group: Applications/System
Source0: https://github.com/sosreport/sos/archive/%{version}/sos-%{version}.tar.gz
Source1: sos-audit-%{auditversion}.tgz
@ -25,6 +25,7 @@ Obsoletes: sos-collector <= 1.9
Patch1: 0001-pulpcore-RFE-export-table-contents-as-CSV.patch
Patch2: 0002-cleaner-Mask-IPv6-addresses-with-trailing-or.patch
Patch3: 0003-revert-PR4092.patch
Patch4: 0004-plugin_aws-fix-unable-to-get-metadata-in-aws.py.patch
%description
Sos is a set of tools that gathers information about system
@ -38,6 +39,7 @@ support technicians and developers.
%patch -P 1 -p1
%patch -P 2 -p1
%patch -P 3 -p1
%patch -P 4 -p1
%build
%py3_build
@ -109,6 +111,10 @@ of the system. Currently storage and filesystem commands are audited.
%changelog
* Fri Dec 05 2025 Jan Jansky <jjansky@redhat.com> = 4.10.1-2
- Update to 4.10.1-2
Resolves: RHEL-121464
* Tue Nov 25 2025 Jan Jansky <jjansky@redhat.com> = 4.10.1-1
- Update to 4.10.1-1
Resolves: RHEL-121464