Ugly Error From ftpPutFileAction when hostname cannot be resolved
Status: Beta
Brought to you by:
whitemice
If ftpPutFileAction cannot resolve a hostname it raises an exception "Errno -5" and an error that makes it clear what happens. But making this error message better - and including the hostname it was attempting to resolve - would be nice.
Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc87-py2.6.egg/coils/logic/workflow/services/process.py", line 825, in work action_name, description = self.run_stanza(action_uuid) File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc87-py2.6.egg/coils/logic/workflow/services/process.py", line 398, in run_stanza parameters=stanza.get('params'), File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc87-py2.6.egg/coils/core/context.py", line 566, in run_command command.run() File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc87-py2.6.egg/coils/core/logic/action.py", line 294, in run self.do_action() File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc87-py2.6.egg/coils/logic/workflow/actions/doc/ftpputfile.py", line 56, in do_action ftp = FTP(self._hostname) File "/usr/lib64/python2.6/ftplib.py", line 116, in __init__ self.connect(host) File "/usr/lib64/python2.6/ftplib.py", line 131, in connect self.sock = socket.create_connection((self.host, self.port), self.timeout) File "/usr/lib64/python2.6/socket.py", line 553, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): gaierror: [Errno -5] No address associated with hostname
same issue can happen for ftpGetFiles, perhaps we should have a base command class for FTP actions that wraps things like FTP connect and manages errors in a more elegant fashion.
still true