aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2020-09-24 10:17:25 -0400
committerJake Hunsaker <jhunsake@redhat.com>2020-10-07 13:55:20 -0400
commit11cc6f478a9b41ce81b5b74faab5ca42930262ee (patch)
treea36be14033719fcce0cf72933029807fbcb4e05f
parenta3b493a8accc338158faa53b9e221067323b75f5 (diff)
downloadsos-11cc6f478a9b41ce81b5b74faab5ca42930262ee.tar.gz
[policy] Use user-provided FTP directory if specified
Fixes an issue whereby we ignore a user-provided FTP directory. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/policies/__init__.py2
-rw-r--r--sos/policies/redhat.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/sos/policies/__init__.py b/sos/policies/__init__.py
index 215739bd..32f271d9 100644
--- a/sos/policies/__init__.py
+++ b/sos/policies/__init__.py
@@ -1677,7 +1677,7 @@ class LinuxPolicy(Policy):
password = self.get_upload_password()
if not directory:
- directory = self._upload_directory
+ directory = self.upload_directory or self._upload_directory
try:
session = ftplib.FTP(url, user, password)
diff --git a/sos/policies/redhat.py b/sos/policies/redhat.py
index f2f847a5..d079406f 100644
--- a/sos/policies/redhat.py
+++ b/sos/policies/redhat.py
@@ -332,7 +332,8 @@ support representative.
if not self.case_id:
# Cannot use the RHCP. Use anonymous dropbox
self.upload_user = self._upload_user
- self.upload_directory = self._upload_directory
+ if self.upload_directory is None:
+ self.upload_directory = self._upload_directory
self.upload_password = None
return RH_FTP_HOST
else: