bugfix ident
This commit is contained in:
parent
927c189b92
commit
6bb4f4d0e5
3 changed files with 45 additions and 64 deletions
2
AUTHORS
2
AUTHORS
|
|
@ -2,5 +2,5 @@ N:Johann Dréo
|
|||
P:nojhan
|
||||
E:nojhan@gmail.com
|
||||
D:2009-06-23
|
||||
C:Initial code, maintener
|
||||
C:Initial code, lead developper
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
current:
|
||||
* added a via_host field (show on which host the tunnel is build)
|
||||
* don't try to show connections if the user is not root
|
||||
|
||||
0.2:
|
||||
* update from the deprecated popen3 functions to the subprocess module (need python >= 2.4)
|
||||
* html help page
|
||||
|
|
|
|||
|
|
@ -33,16 +33,7 @@ from operator import itemgetter
|
|||
class SSHTunnel(dict):
|
||||
"""A dictionary that stores an SSH connection related to a tunnel"""
|
||||
|
||||
def __init__(self,
|
||||
local_address = '1.1.1.1',
|
||||
local_port = 0,
|
||||
foreign_address = '1.1.1.1',
|
||||
foreign_port = 0,
|
||||
target_host = "Unknown",
|
||||
status = 'UNKNOWN',
|
||||
ssh_pid = 0,
|
||||
autossh_pid = 0
|
||||
):
|
||||
def __init__(self, local_address = '1.1.1.1', local_port = 0, foreign_address = '1.1.1.1', foreign_port = 0, target_host = "Unknown", status = 'UNKNOWN', ssh_pid = 0, autossh_pid = 0 ):
|
||||
|
||||
# informations available with netstat
|
||||
self['local_address'] = local_address
|
||||
|
|
@ -274,25 +265,9 @@ class AutoSSHTunnelMonitor(list):
|
|||
# add to the list of tunnels of the AutoSSHInstance instance
|
||||
i['tunnels'] += [t]
|
||||
|
||||
return autosshs
|
||||
|
||||
# instanciation
|
||||
tunnels += [ SSHTunnel( local_addr, local_port, foreign_addr, foreign_port, autohost, status, sshpid, ppid ) ]
|
||||
|
||||
return tunnels
|
||||
|
||||
|
||||
def bind_tunnels(self, autosshs, tunnels):
|
||||
"""Bind autossh process to the related ssh connections, according to the pid"""
|
||||
for t in tunnels:
|
||||
for i in autosshs:
|
||||
if i['pid'] == t['autossh_pid']:
|
||||
# add to the list of tunnels of the AutoSSHInstance instance
|
||||
i['tunnels'] += [t]
|
||||
|
||||
return autosshs
|
||||
|
||||
|
||||
#################################################################################################
|
||||
# INTERFACES
|
||||
#################################################################################################
|
||||
|
|
@ -359,6 +334,8 @@ class monitorCurses:
|
|||
if kc != -1: # if keypress
|
||||
pass
|
||||
|
||||
ch = chr(0)
|
||||
|
||||
if 0 < kc < 256: # if ascii key
|
||||
# ascii character from the keycode
|
||||
ch = chr(kc)
|
||||
|
|
|
|||
Loading…
Reference in a new issue