aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2023-01-23 08:57:45 +0100
committerJake Hunsaker <jhunsake@redhat.com>2023-01-27 12:18:56 -0500
commit31b991ef2b51856264c911018eddea8dd55b5718 (patch)
tree43cacdcc490ac4e2a3ef1b3d6cf3324327b79202
parent4267a41313588443c4bc4c3a161d13895d4f2f42 (diff)
downloadsos-31b991ef2b51856264c911018eddea8dd55b5718.tar.gz
[redhat] Failover to SFTP credentials prompt when no caseid
When no case id is provided during upload, a prompt of username must fail over to SFTP upload. Relevant: #3117 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r--sos/policies/distros/redhat.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/sos/policies/distros/redhat.py b/sos/policies/distros/redhat.py
index 92288e74..b02817de 100644
--- a/sos/policies/distros/redhat.py
+++ b/sos/policies/distros/redhat.py
@@ -266,11 +266,19 @@ support representative.
if self.commons['cmdlineopts'].upload_url:
super(RHELPolicy, self).prompt_for_upload_user()
return
- if self.case_id and not self.get_upload_user():
- self.upload_user = input(_(
- "Enter your Red Hat Customer Portal username for uploading ["
- "empty for anonymous SFTP]: ")
- )
+ if not self.get_upload_user():
+ if self.case_id:
+ self.upload_user = input(_(
+ "Enter your Red Hat Customer Portal username for "
+ "uploading [empty for anonymous SFTP]: ")
+ )
+ else: # no case id provided => failover to SFTP
+ self.upload_url = RH_SFTP_HOST
+ self.ui_log.info("No case id provided, uploading to SFTP")
+ self.upload_user = input(_(
+ "Enter your Red Hat Customer Portal username for "
+ "uploading to SFTP [empty for anonymous]: ")
+ )
def get_upload_url(self):
if self.upload_url: