Replace twitter-commons dependencies with paramiko
Closed this issue · 0 comments
Currently, zk-shell has a dependency with twitter-commons, which creates the SSH tunnels to access the Zookeepers clusters. The problem is that twitter-commons requieres a lot more dependencies that doesn´t even use to create the tunnels, making zk-shell a lot more "overloaded" that it should be.
The use of a specific SSH library for creating tunnels called Paramiko (https://github.com/paramiko/paramiko) should solve this problem. The difference between these two is that Paramiko does not have a simple and direct function-call like twitter-commons has to create these tunnels
lhost, lport = TunnelHelper.create_tunnel(rhost, rport, self._tunnel)
Thus, the use of Paramiko to achieve the same functionality will requiere a new dependency within shell.py. This will be a new python source-code called something like tunnel.py
or paramiko_tunnel.py; it will have a class called TunnelHelper that encapsulates all the functionalities of Paramiko for the creation and maintenance of tunnels. This implementation should behave the same way as it is now, so the function create_tunnel shall return the same values as the one of twitter-commons.
Another needed feature in the current implementation is the use of some unit tests. In this new implementation I will try to include some unit tests to increase the test coverage of the program.