yanne / api-test

0 stars 0 forks source link

"close connection" keyword won't remove current connection instance from connectioncache._connections list #102

Open yanne opened 10 years ago

yanne commented 10 years ago

In SSHLibrary.library.py, The "close_connection()" method invokes "close()" method provided by sshclient instance without updating information kept in "_connections" attirbute of robot.utils.ConnectionCache class. Reproduce steps:

  1. initiate a ssh connection with alias "SUT" as current connection: |open connection| host | alias=SUT |
  2. close this connection |close connection|
  3. try to get connection with this alias |${index}= |get connection| SUT |
  4. The closed connection can be fetched and operations afterwards will fail | switch connection| SUT|

AttributeError: 'NoneType' object has no attribute 'open_sftp_client'

include the following information:

This issue was originally opened at Google Code on Mar 6, 2014.

yanne commented 10 years ago

Original comment by jussi.ao...@gmail.com on Jun 1, 2014.

So it does. The robot.utils.ConnectionCache doesnt seem to have public API any way to remove a connection from it.

That said, I dont know if actually removing a closed connection is necessary. Maybe a nice error message that the user is trying to operate on a closed connection would be enough?