So i know this question has been asked many times but i cant seem to understand what i need to put in the init def. When i am calling the open_ssh_tunnel function. The error TypeError: open_ssh_tunnel() missing 1 required positional argument: 'self'. Any help would be much appreciated.
def __init__(self):
???
def open_ssh_tunnel(self, verbose=False):
"""Open an SSH tunnel and connect using a username and password.
:param verbose: Set to True to show logging
:return tunnel: Global SSH tunnel connection
"""
if verbose:
sshtunnel.DEFAULT_LOGLEVEL = logging.DEBUG
global tunnel
tunnel = SSHTunnelForwarder(
(self.ssh_host, 22),
ssh_username= self.ssh_username,
ssh_password= self.ssh_password,
remote_bind_address=('127.0.0.1', 3306)
)
tunnel.start()