aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2022-03-01 11:51:18 +0100
committerJake Hunsaker <jhunsake@redhat.com>2022-03-01 11:55:10 -0500
commit1bcb44916a66fd0a316708b9d02f432fabe65f18 (patch)
tree9d2f1fd0ac00fa96402b7e09e0f975952ed55c4a
parent045609e5705b1643fe2e800206b38a4ca4d30b02 (diff)
downloadsos-1bcb44916a66fd0a316708b9d02f432fabe65f18.tar.gz
[redhat] Honour credential-less --upload-url on RedHat distro properly
When missing some credentials, do overwrite upload_url to the Red Hat SFTP server *only* when upload-url points to the Customer Portal API server. Resolves: #2869 Closes: #2870 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r--sos/policies/distros/redhat.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/sos/policies/distros/redhat.py b/sos/policies/distros/redhat.py
index dd053548..857b84d5 100644
--- a/sos/policies/distros/redhat.py
+++ b/sos/policies/distros/redhat.py
@@ -377,7 +377,8 @@ support representative.
from RHCP failures to the public RH dropbox
"""
try:
- if not self.get_upload_user() or not self.get_upload_password():
+ if 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
uploaded = super(RHELPolicy, self).upload_archive(archive)
except Exception: