saga-project / bliss

ATTENTION: bliss is now saga-python. Please check out the new project website for the latest version: http://saga-project.github.com/saga-python/
http://saga-project.github.com/saga-python/
Other
8 stars 4 forks source link

paramaiko acting stupid on empty host in URLb #75

Closed andre-merzky closed 11 years ago

andre-merzky commented 11 years ago

triggered on the following test::

merzky@thinkie:~/saga/bliss (feature/attributes *$%) $ python test/compliance/file/03_copy_local_remote_etc.py sftp:///tmp/ /etc/passwd         /usr/local/lib/python2.6/dist-packages/pycrypto_on_pypi-2.3-py2.6-linux-x86_64.egg/Crypto/Util/randpool.py:40: RandomPool_DeprecationWarning: This application uses RandomPool, which is BROKEN in older releases.  See http://www.pycrypto.org/randpool-broken
  RandomPool_DeprecationWarning)
Size: 356352
File Size: 1884

============================================
File / directory tests seems to have FAILED!
============================================

SAGA Exception (NoSuccess): [saga.plugin.file.sftp] Couldn't copy file 'sftp://localhost//etc/passwd' to 'sftp:///tmp//sagaproj-ac8048d4-e321-11e1-967d-00231582da34/': 'NoneType' object has no attribute 'startswith'
Traceback (most recent call last):
  File "/home/merzky/saga/bliss/bliss/plugins/sftp/sftpfile.py", line 533, in file_copy
    ssh.connect(hostname=hostname, port=int(port), username=username, allow_agent=True, look_for_keys=True)
  File "/usr/lib/pymodules/python2.6/paramiko/client.py", line 311, in connect
    self._policy.missing_host_key(self, server_hostkey_name, server_key)
  File "/usr/lib/pymodules/python2.6/paramiko/client.py", line 71, in missing_host_key
    client.save_host_keys(client._host_keys_filename)
  File "/usr/lib/pymodules/python2.6/paramiko/client.py", line 190, in save_host_keys
    for hostname, keys in self._host_keys.iteritems():
  File "/usr/lib/python2.6/UserDict.py", line 110, in iteritems
    yield (k, self[k])
  File "/usr/lib/pymodules/python2.6/paramiko/hostkeys.py", line 258, in __getitem__
    ret = self.lookup(key)
  File "/usr/lib/pymodules/python2.6/paramiko/hostkeys.py", line 224, in lookup
    if (h.startswith('|1|') and (self.hash_host(hostname, h) == h)) or (h == hostname):
AttributeError: 'NoneType' object has no attribute 'startswith'

Please run this test again with SAGA_VERBOSE=5
and report the results at:

https://github.com/saga-project/bliss/issues

The same test works fine with the url sftp://localhost/tmp//

andre-merzky commented 11 years ago

fixed in saga-python (which will not use paramiko)