1
0
forked from rpms/sos

sos updates to RHEL9.0

This commit is contained in:
pmoravec 2021-11-30 21:32:43 +00:00
parent e5162f63d5
commit e4ea153e48
2 changed files with 79 additions and 1 deletions

View File

@ -148,3 +148,77 @@ index 50183e873..42a7731d6 100644
try:
self.policy.upload_archive(arc_name)
self.ui_log.info("Uploaded archive successfully")
From abb2fc65bd14760021c61699ad3113cab3bd4c64 Mon Sep 17 00:00:00 2001
From: Pavel Moravec <pmoravec@redhat.com>
Date: Tue, 30 Nov 2021 11:37:02 +0100
Subject: [PATCH 1/2] [redhat] Fix broken URI to upload to customer portal
Revert back the unwanted change in URI of uploading tarball to the
Red Hat Customer portal.
Related: #2772
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
---
sos/policies/distros/redhat.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sos/policies/distros/redhat.py b/sos/policies/distros/redhat.py
index e4e2b883..eb442407 100644
--- a/sos/policies/distros/redhat.py
+++ b/sos/policies/distros/redhat.py
@@ -250,7 +250,7 @@ support representative.
elif self.commons['cmdlineopts'].upload_protocol == 'sftp':
return RH_SFTP_HOST
else:
- rh_case_api = "/hydra/rest/cases/%s/attachments"
+ rh_case_api = "/support/v1/cases/%s/attachments"
return RH_API_HOST + rh_case_api % self.case_id
def _get_upload_headers(self):
--
2.31.1
From ea4f9e88a412c80a4791396e1bb78ac1e24ece14 Mon Sep 17 00:00:00 2001
From: Pavel Moravec <pmoravec@redhat.com>
Date: Tue, 30 Nov 2021 13:00:26 +0100
Subject: [PATCH 2/2] [policy] Add error message when FTP upload write failure
When (S)FTP upload fails to write the destination file,
our "expect" code should detect it sooner than after timeout happens
and write appropriate error message.
Resolves: #2772
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
---
sos/policies/distros/__init__.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sos/policies/distros/__init__.py b/sos/policies/distros/__init__.py
index 6f257fdc..7bdc81b8 100644
--- a/sos/policies/distros/__init__.py
+++ b/sos/policies/distros/__init__.py
@@ -473,7 +473,8 @@ class LinuxPolicy(Policy):
put_expects = [
u'100%',
pexpect.TIMEOUT,
- pexpect.EOF
+ pexpect.EOF,
+ u'No such file or directory'
]
put_success = ret.expect(put_expects, timeout=180)
@@ -485,6 +486,8 @@ class LinuxPolicy(Policy):
raise Exception("Timeout expired while uploading")
elif put_success == 2:
raise Exception("Unknown error during upload: %s" % ret.before)
+ elif put_success == 3:
+ raise Exception("Unable to write archive to destination")
else:
raise Exception("Unexpected response from server: %s" % ret.before)
--
2.31.1

View File

@ -5,7 +5,7 @@
Summary: A set of tools to gather troubleshooting information from a system
Name: sos
Version: 4.2
Release: 5%{?dist}
Release: 6%{?dist}
Group: Applications/System
Source0: https://github.com/sosreport/sos/archive/%{version}/sos-%{version}.tar.gz
Source1: sos-audit-%{auditversion}.tgz
@ -131,6 +131,10 @@ of the system. Currently storage and filesystem commands are audited.
%changelog
* Tue Nov 30 2021 Pavel Moravec <pmoravec@redhat.com> = 4.2-6
- [redhat] Fix broken URI to upload to customer portal
Resolves: bz2025611
* Mon Nov 22 2021 Pavel Moravec <pmoravec@redhat.com> = 4.2-5
- [clean,hostname_parser] Source /etc/hosts for obfuscation
Resolves: bz2024893