aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2021-01-13 10:57:58 -0500
committerJake Hunsaker <jhunsake@redhat.com>2021-01-15 11:14:59 -0500
commit486a7918934041306bae8ccc11da2196e8f4c9bb (patch)
tree20cbbd082903d38e344d1aefb1fbcc551d360232
parentbb1e6c433c1779966c43e2d000ed46edebabf3b4 (diff)
downloadsos-486a7918934041306bae8ccc11da2196e8f4c9bb.tar.gz
[Policy] Handle additional FTP authentication issues
It was found that some implementations will return a 530 rather than a 503 as the more specific error for incorrect passwords. Handle this error code explicitly, and then also add a catch-all for any other ftplib errors that may get raised. Resolves: #2368 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/policies/distros/__init__.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/sos/policies/distros/__init__.py b/sos/policies/distros/__init__.py
index c5fb4801..a4f550c9 100644
--- a/sos/policies/distros/__init__.py
+++ b/sos/policies/distros/__init__.py
@@ -477,9 +477,13 @@ class LinuxPolicy(Policy):
errno = str(err).split()[0]
if errno == '503':
raise Exception("could not login as '%s'" % user)
+ if errno == '530':
+ raise Exception("invalid password for user '%s'" % user)
if errno == '550':
raise Exception("could not set upload directory to %s"
% directory)
+ raise Exception("error trying to establish session: %s"
+ % str(err))
try:
with open(self.upload_archive, 'rb') as _arcfile: