debug_tcp_sockets: clearly mark as global var
Change-Id: I56e26590ea380c7deab7ce132d688b37eb2d11a3
This commit is contained in:
parent
ac0b59d93a
commit
cb320b8ddf
|
@ -39,6 +39,7 @@ def cmd(what):
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
def print_used_tcp_sockets():
|
def print_used_tcp_sockets():
|
||||||
|
global debug_tcp_sockets
|
||||||
if not debug_tcp_sockets:
|
if not debug_tcp_sockets:
|
||||||
return
|
return
|
||||||
cmd('ls /proc/self/fd');
|
cmd('ls /proc/self/fd');
|
||||||
|
@ -68,6 +69,7 @@ class VTYInteract(object):
|
||||||
self.last_node = ''
|
self.last_node = ''
|
||||||
|
|
||||||
def _close_socket(self):
|
def _close_socket(self):
|
||||||
|
global debug_tcp_sockets
|
||||||
if self.socket:
|
if self.socket:
|
||||||
if debug_tcp_sockets:
|
if debug_tcp_sockets:
|
||||||
VTYInteract.all_sockets.remove(self.socket)
|
VTYInteract.all_sockets.remove(self.socket)
|
||||||
|
@ -131,6 +133,7 @@ class VTYInteract(object):
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def _common_command(self, request, close=False, ends=None):
|
def _common_command(self, request, close=False, ends=None):
|
||||||
|
global debug_tcp_sockets
|
||||||
if not ends:
|
if not ends:
|
||||||
ends = [self.norm_end, self.priv_end]
|
ends = [self.norm_end, self.priv_end]
|
||||||
if not self.socket:
|
if not self.socket:
|
||||||
|
|
Loading…
Reference in New Issue