aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sos/policies/redhat.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/sos/policies/redhat.py b/sos/policies/redhat.py
index d079406f..3a65b9fa 100644
--- a/sos/policies/redhat.py
+++ b/sos/policies/redhat.py
@@ -324,13 +324,21 @@ support representative.
self.upload_url = RH_FTP_HOST
self.upload_user = self._upload_user
+ def _upload_user_set(self):
+ user = self.get_upload_user()
+ return user and (user != 'anonymous')
+
def get_upload_url(self):
if self.upload_url:
return self.upload_url
if self.commons['cmdlineopts'].upload_url:
return self.commons['cmdlineopts'].upload_url
- if not self.case_id:
- # Cannot use the RHCP. Use anonymous dropbox
+ # anonymous FTP server should be used as fallback when either:
+ # - case id is not set, or
+ # - upload user isn't set AND batch mode prevents to prompt for it
+ if (not self.case_id) or \
+ ((not self._upload_user_set()) and
+ self.commons['cmdlineopts'].batch):
self.upload_user = self._upload_user
if self.upload_directory is None:
self.upload_directory = self._upload_directory