From 5583de792b1dc72bdb4e15489c895770da9ee391 Mon Sep 17 00:00:00 2001 From: illuminatus Date: Fri, 3 Jan 2025 11:36:08 -0800 Subject: [PATCH] For review suggestions / feedback If acceptable will fixup/squash so commit message and sign-off is proper. Signed-off-by: Trevor Benson --- sos/policies/distros/redhat.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sos/policies/distros/redhat.py b/sos/policies/distros/redhat.py index d61b70e2f..86b25e58d 100644 --- a/sos/policies/distros/redhat.py +++ b/sos/policies/distros/redhat.py @@ -255,13 +255,9 @@ def get_upload_url(self): if self.commons['cmdlineopts'].upload_protocol == 'sftp': return RH_SFTP_HOST if self.commons['cmdlineopts'].upload_protocol == 's3': - endpoint = self.get_upload_s3_endpoint() bucket = self.get_upload_s3_bucket() - if self.commons['cmdlineopts'].case_id: - rh_case_api = "/support/v1/cases/%s/attachments" - return f"{endpoint}/{bucket}" + rh_case_api % self.case_id prefix = self.get_upload_s3_object_prefix() - return f"{endpoint}/{bucket}/{prefix}" + return f"s3://{bucket}/{prefix}" if not self.commons['cmdlineopts'].case_id: self.ui_log.info("No case id provided, uploading to SFTP") return RH_SFTP_HOST @@ -307,6 +303,9 @@ def get_upload_url_string(self): return "Red Hat Customer Portal" if self.get_upload_url().startswith(RH_SFTP_HOST): return "Red Hat Secure FTP" + if self.get_upload_url().startswith('s3://'): + endpoint = self.get_upload_s3_endpoint() + return f"{self.get_upload_url()} on endpoint {endpoint}" return self._get_obfuscated_upload_url(self.upload_url) def _get_sftp_upload_name(self):