Compare commits
10 Commits
changed/a8
...
c8
Author | SHA1 | Date | |
---|---|---|---|
3b03cb9eca | |||
a38c3757d0 | |||
8e4ba32c9a | |||
2b6c5de85d | |||
|
cce1af82c4 | ||
|
157c2d14d2 | ||
|
61cc2ee9bf | ||
|
e3bb8bf563 | ||
fb09e4e130 | |||
d3882c8950 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,2 @@
|
|||||||
SOURCES/sos-4.5.3.tar.gz
|
SOURCES/sos-4.7.2.tar.gz
|
||||||
SOURCES/sos-audit-0.3.tgz
|
SOURCES/sos-audit-0.3.tgz
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
eec8ce79aa42dd6561bce9638c8e803e9f81e476 SOURCES/sos-4.5.3.tar.gz
|
e01a25f05322cf56b75e07b5102dd61dbd4f0869 SOURCES/sos-4.7.2.tar.gz
|
||||||
9d478b9f0085da9178af103078bbf2fd77b0175a SOURCES/sos-audit-0.3.tgz
|
9d478b9f0085da9178af103078bbf2fd77b0175a SOURCES/sos-audit-0.3.tgz
|
||||||
|
77
SOURCES/sos-RHEL-22732-reverted.patch
Normal file
77
SOURCES/sos-RHEL-22732-reverted.patch
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
From 11879fbb1adc33d8abc0cb70dc63e7e88c39fc3f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jose Castillo <jcastillo@redhat.com>
|
||||||
|
Date: Wed, 21 Feb 2024 12:24:37 +0000
|
||||||
|
Subject: [PATCH] [redhat|policy] Check for archive size before upload
|
||||||
|
|
||||||
|
The Red Hat Customer Portal has a max limit for
|
||||||
|
single http requests of 1Gb. From sos side, we never checked this
|
||||||
|
and so customers had to wait for the whole upload to be attempted
|
||||||
|
before receiving an error from the portal.
|
||||||
|
This patch attempts to stop the upload before it starts, informing
|
||||||
|
customers of such limit, and switching to secure FTP where there's
|
||||||
|
no limit.
|
||||||
|
|
||||||
|
Related: RHEL-22732
|
||||||
|
|
||||||
|
Signed-off-by: Jose Castillo <jcastillo@redhat.com>
|
||||||
|
---
|
||||||
|
sos/policies/distros/redhat.py | 29 +++++++++++++++++++++++------
|
||||||
|
1 file changed, 23 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/sos/policies/distros/redhat.py b/sos/policies/distros/redhat.py
|
||||||
|
index edea151e2..2fb0df3fa 100644
|
||||||
|
--- a/sos/policies/distros/redhat.py
|
||||||
|
+++ b/sos/policies/distros/redhat.py
|
||||||
|
@@ -22,7 +22,7 @@
|
||||||
|
from sos.policies.package_managers.rpm import RpmPackageManager
|
||||||
|
from sos.policies.package_managers.flatpak import FlatpakPackageManager
|
||||||
|
from sos.policies.package_managers import MultiPackageManager
|
||||||
|
-from sos.utilities import bold
|
||||||
|
+from sos.utilities import bold, convert_bytes
|
||||||
|
from sos import _sos as _
|
||||||
|
|
||||||
|
try:
|
||||||
|
@@ -232,6 +232,8 @@ class RHELPolicy(RedHatPolicy):
|
||||||
|
_upload_url = RH_SFTP_HOST
|
||||||
|
_upload_method = 'post'
|
||||||
|
_device_token = None
|
||||||
|
+ # Max size for an http single request is 1Gb
|
||||||
|
+ _max_size_request = 1073741824
|
||||||
|
|
||||||
|
def __init__(self, sysroot=None, init=None, probe_runtime=True,
|
||||||
|
remote_exec=None):
|
||||||
|
@@ -429,15 +429,30 @@ support representative.
|
||||||
|
return super().upload_sftp(user=_user, password=_token)
|
||||||
|
raise Exception("Could not retrieve valid or anonymous credentials")
|
||||||
|
|
||||||
|
+ def check_file_too_big(self, archive):
|
||||||
|
+ size = os.path.getsize(archive)
|
||||||
|
+ # Lets check if the size is bigger than the limit.
|
||||||
|
+ # There's really no need to transform the size to Gb,
|
||||||
|
+ # so we don't need to call any size converter implemented
|
||||||
|
+ # in tools.py
|
||||||
|
+ if (size >= self._max_size_request):
|
||||||
|
+ self.ui_log.warning(
|
||||||
|
+ _("Size of archive is bigger than Red Hat Customer Portal "
|
||||||
|
+ "limit for uploads of "
|
||||||
|
+ f"{convert_bytes(self._max_size_request)} "
|
||||||
|
+ " via sos http upload. \n")
|
||||||
|
+ )
|
||||||
|
+ return RH_SFTP_HOST
|
||||||
|
+ else:
|
||||||
|
+ return RH_API_HOST
|
||||||
|
+
|
||||||
|
def upload_archive(self, archive):
|
||||||
|
"""Override the base upload_archive to provide for automatic failover
|
||||||
|
from RHCP failures to the public RH dropbox
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
- if self.upload_url and self.upload_url.startswith(RH_API_HOST) and\
|
||||||
|
- (not self.get_upload_user() or
|
||||||
|
- not self.get_upload_password()):
|
||||||
|
- self.upload_url = RH_SFTP_HOST
|
||||||
|
+ if self.get_upload_url().startswith(RH_API_HOST):
|
||||||
|
+ self.upload_url = self.check_file_too_big(archive)
|
||||||
|
uploaded = super().upload_archive(archive)
|
||||||
|
except Exception as e:
|
||||||
|
uploaded = False
|
@ -1,33 +0,0 @@
|
|||||||
diff -aruN sos-4.3/sos/policies/distros/redhat.py sos-4.3.alma/sos/policies/distros/redhat.py
|
|
||||||
--- sos-4.3/sos/policies/distros/redhat.py 2022-02-15 07:20:20.000000000 +0300
|
|
||||||
+++ sos-4.3.alma/sos/policies/distros/redhat.py 2022-10-10 11:40:12.000000000 +0300
|
|
||||||
@@ -434,6 +434,14 @@
|
|
||||||
vendor = "CentOS"
|
|
||||||
vendor_urls = [('Community Website', 'https://www.centos.org/')]
|
|
||||||
|
|
||||||
+class AlmaLinuxPolicy(RHELPolicy):
|
|
||||||
+ distro = "AlmaLinux"
|
|
||||||
+ vendor = "AlmaLinux OS Foundation"
|
|
||||||
+ vendor_urls = [
|
|
||||||
+ ('Distribution Website', 'https://www.almalinux.org/'),
|
|
||||||
+ ('Commercial Support', 'https://tuxcare.com/linux-support-services/')
|
|
||||||
+ ]
|
|
||||||
+
|
|
||||||
|
|
||||||
class RedHatAtomicPolicy(RHELPolicy):
|
|
||||||
distro = "Red Hat Atomic Host"
|
|
||||||
@@ -591,6 +599,14 @@
|
|
||||||
vendor = "CentOS"
|
|
||||||
vendor_urls = [('Community Website', 'https://www.centos.org/')]
|
|
||||||
|
|
||||||
+class AlmaLinuxAtomicPolicy(RedHatAtomicPolicy):
|
|
||||||
+ distro = "AlmaLinux Atomic Host"
|
|
||||||
+ vendor = "AlmaLinux OS Foundation"
|
|
||||||
+ vendor_urls = [
|
|
||||||
+ ('Distribution Website', 'https://www.almalinux.org/'),
|
|
||||||
+ ('Commercial Support', 'https://tuxcare.com/linux-support-services/')
|
|
||||||
+ ]
|
|
||||||
+
|
|
||||||
|
|
||||||
class FedoraPolicy(RedHatPolicy):
|
|
||||||
"""
|
|
@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
Summary: A set of tools to gather troubleshooting information from a system
|
Summary: A set of tools to gather troubleshooting information from a system
|
||||||
Name: sos
|
Name: sos
|
||||||
Version: 4.5.3
|
Version: 4.7.2
|
||||||
Release: 1%{?dist}.alma
|
Release: 2%{?dist}
|
||||||
Group: Applications/System
|
Group: Applications/System
|
||||||
Source0: https://github.com/sosreport/sos/archive/%{version}/sos-%{version}.tar.gz
|
Source0: https://github.com/sosreport/sos/archive/%{version}/sos-%{version}.tar.gz
|
||||||
Source1: sos-audit-%{auditversion}.tgz
|
Source1: sos-audit-%{auditversion}.tgz
|
||||||
@ -16,15 +16,13 @@ BuildRequires: python3-devel
|
|||||||
BuildRequires: gettext
|
BuildRequires: gettext
|
||||||
BuildRequires: python3-setuptools
|
BuildRequires: python3-setuptools
|
||||||
Requires: python3-requests
|
Requires: python3-requests
|
||||||
|
Requires: python3-setuptools
|
||||||
Recommends: python3-magic
|
Recommends: python3-magic
|
||||||
Recommends: python3-pexpect
|
Recommends: python3-pexpect
|
||||||
Recommends: python3-pyyaml
|
Recommends: python3-pyyaml
|
||||||
Conflicts: vdsm < 4.40
|
Conflicts: vdsm < 4.40
|
||||||
Obsoletes: sos-collector
|
Obsoletes: sos-collector
|
||||||
|
Patch0: sos-RHEL-22732-reverted.patch
|
||||||
|
|
||||||
# almalinux
|
|
||||||
Patch1000: sos-almalinux-branding.patch
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Sos is a set of tools that gathers information about system
|
Sos is a set of tools that gathers information about system
|
||||||
@ -35,11 +33,9 @@ support technicians and developers.
|
|||||||
%prep
|
%prep
|
||||||
%setup -qn %{name}-%{version}
|
%setup -qn %{name}-%{version}
|
||||||
%setup -T -D -a1 -q
|
%setup -T -D -a1 -q
|
||||||
|
%patch0 -p1 -R
|
||||||
|
|
||||||
|
|
||||||
# almalinux
|
|
||||||
%patch1000 -p1
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%py3_build
|
%py3_build
|
||||||
|
|
||||||
@ -111,8 +107,77 @@ of the system. Currently storage and filesystem commands are audited.
|
|||||||
%ghost /etc/audit/rules.d/40-sos-storage.rules
|
%ghost /etc/audit/rules.d/40-sos-storage.rules
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Wed May 31 2023 Andrew Lukoshko <alukoshko@almalinux.org> - 4.5.3-1.alma
|
* Wed Aug 21 2024 Pavel Moravec <pmoravec@redhat.com> = 4.7.2-2
|
||||||
- Debrand for AlmaLinux
|
- reverting RHEL-22732 patch due to regressions
|
||||||
|
Resolves: RHEL-49779
|
||||||
|
|
||||||
|
* Fri Jun 21 2024 Pierguido Lambri <plambri@redhat.com> = 4.7.2-1
|
||||||
|
- New upstream release
|
||||||
|
Resolves: RHEL-40871
|
||||||
|
Resolves: RHEL-33703
|
||||||
|
Resolves: RHEL-22732
|
||||||
|
|
||||||
|
* Thu May 09 2024 Pavel Moravec <pmoravec@redhat.com> = 4.7.1-3
|
||||||
|
- [archive] Fix get_archive_root after files reordering
|
||||||
|
Resolves: RHEL-35945
|
||||||
|
|
||||||
|
* Mon Apr 08 2024 Jan Jansky <jjansky@redhat.com> = 4.7.1-1
|
||||||
|
- rebase to upstream 4.7.1
|
||||||
|
Resolves: RHEL-32104
|
||||||
|
|
||||||
|
* Tue Feb 20 2024 Jan Jansky <jjansky@redhat.com> = 4.7.0-1
|
||||||
|
- rebase to upstream 4.7.0
|
||||||
|
Resolves: RHEL-26111
|
||||||
|
|
||||||
|
* Thu Jan 11 2024 Pavel Moravec <pmoravec@redhat.com> = 4.6.1-1
|
||||||
|
- rebase to upstream 4.6.1
|
||||||
|
Resolves: RHEL-21173
|
||||||
|
- [redhat] Change authentication method for RHEL
|
||||||
|
Resolves: RHEL-21177
|
||||||
|
|
||||||
|
* Wed Oct 18 2023 Pavel Moravec <pmoravec@redhat.com> = 4.6.0-5
|
||||||
|
[pulpcore] Scrub AUTH_LDAP_BIND_PASSWORD value
|
||||||
|
Resolves: RHEL-13697
|
||||||
|
|
||||||
|
* Tue Oct 17 2023 Pavel Moravec <pmoravec@redhat.com> = 4.6.0-4
|
||||||
|
- [pulp] Fix dynaconf obfuscation and add AUTH_LDAP_BIND_PASSWORD
|
||||||
|
Resolves: RHEL-13697
|
||||||
|
|
||||||
|
* Fri Sep 01 2023 Pavel Moravec <pmoravec@redhat.com> = 4.6.0-2
|
||||||
|
- [openshift_ovn] Collect additional ovnkube node logs
|
||||||
|
Resolves: SUPDEV145
|
||||||
|
|
||||||
|
* Wed Aug 23 2023 Jan Jansky <jjansky@redhat.com> = 4.6.0-1
|
||||||
|
- [cleaner] Use data filter for extraction
|
||||||
|
Resolves: bz2218873
|
||||||
|
|
||||||
|
* Thu Jul 27 2023 Pavel Moravec <pmoravec@redhat.com> = 4.5.6-1
|
||||||
|
- Rebase sos to 4.5.6
|
||||||
|
Resolves: bz2226724
|
||||||
|
|
||||||
|
* Fri Jul 14 2023 Jan Jansky <jjansky@redhat.com> = 4.5.5-2
|
||||||
|
- Adding patch for mac obfuscation
|
||||||
|
Resolves: bz2218279
|
||||||
|
Resolves: bz2216608
|
||||||
|
Resolves: bz2207562
|
||||||
|
|
||||||
|
* Mon Jul 03 2023 Jan Jansky <jjansky@redhat.com> = 4.5.5-1
|
||||||
|
- [clean] Respect permissions of sanitised files
|
||||||
|
Resolves: bz2218279
|
||||||
|
- [plugin] Fix exception when calling os.makedirs
|
||||||
|
Resolves: bz2216608
|
||||||
|
- [cleaner] Enhance trailing characters list after AMC address
|
||||||
|
Resolves: bz2207562
|
||||||
|
|
||||||
|
* Thu Jun 01 2023 Pavel Moravec <pmoravec@redhat.com> = 4.5.4-1
|
||||||
|
- [plugins] collect strings before commands
|
||||||
|
Resolves: bz2203141
|
||||||
|
- [collector] collect report from primary node if in node_list
|
||||||
|
Resolves: bz2186460
|
||||||
|
- [powerpc] collect invscout logs
|
||||||
|
Resolves: bz2210543
|
||||||
|
- [rhc] New plugin for RHC
|
||||||
|
Resolves: bz2196649
|
||||||
|
|
||||||
* Fri May 05 2023 Jan Jansky <jjansky@redhat.com> = 4.5.3-1
|
* Fri May 05 2023 Jan Jansky <jjansky@redhat.com> = 4.5.3-1
|
||||||
- [report] Ignore case when scrubbing via do_file_sub
|
- [report] Ignore case when scrubbing via do_file_sub
|
||||||
@ -121,6 +186,7 @@ of the system. Currently storage and filesystem commands are audited.
|
|||||||
Resolves: bz2177282
|
Resolves: bz2177282
|
||||||
- [virsh] Scrub passwords in virt-manager logs
|
- [virsh] Scrub passwords in virt-manager logs
|
||||||
Resolves: bz2184062
|
Resolves: bz2184062
|
||||||
|
|
||||||
* Wed Mar 08 2023 Pavel Moravec <pmoravec@redhat.com> = 4.5.1-3
|
* Wed Mar 08 2023 Pavel Moravec <pmoravec@redhat.com> = 4.5.1-3
|
||||||
- Rebase on upstream 4.5.1
|
- Rebase on upstream 4.5.1
|
||||||
Resolves: bz2175806
|
Resolves: bz2175806
|
||||||
@ -132,6 +198,7 @@ of the system. Currently storage and filesystem commands are audited.
|
|||||||
Resolves: bz2176086
|
Resolves: bz2176086
|
||||||
- [cleaner] dont clean sys_tmp from final_path
|
- [cleaner] dont clean sys_tmp from final_path
|
||||||
Resolves: bz2176218
|
Resolves: bz2176218
|
||||||
|
|
||||||
* Tue Feb 07 2023 Pavel Moravec <pmoravec@redhat.com> = 4.5.0-1
|
* Tue Feb 07 2023 Pavel Moravec <pmoravec@redhat.com> = 4.5.0-1
|
||||||
- Rebase on upstream 4.5.0
|
- Rebase on upstream 4.5.0
|
||||||
Resolves: bz2082614
|
Resolves: bz2082614
|
||||||
|
Loading…
Reference in New Issue
Block a user