Skip to content

Commit

Permalink
For review suggestions / feedback
Browse files Browse the repository at this point in the history
If acceptable will fixup/squash so commit message and sign-off is proper.
  • Loading branch information
TrevorBenson authored Jan 3, 2025
1 parent c1fe344 commit 2dbdd7c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions sos/policies/distros/redhat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -307,6 +303,8 @@ 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://'):
return f"{self.get_upload_url()} on endpoint {self.get_upload_s3_endpoint()}"
return self._get_obfuscated_upload_url(self.upload_url)

def _get_sftp_upload_name(self):
Expand Down

0 comments on commit 2dbdd7c

Please sign in to comment.