Skip to content
Permalink
Browse files

Add a __str__ method to the ClientHandler class

So the daemon stop reports:

n1.osvcd.listener stop client handler thread (client addr: 192.168.99.16, usr: lva, auth: x509, scheme: h2)
n1.osvcd.listener stop client handler thread (client addr: local, usr: False, auth: uxsock, scheme: h2)
n1.osvcd.listener stop client handler thread (client addr: local, usr: False, auth: uxsock, scheme: h2)
...

Instead of:

n1.osvcd.listener stop <ClientHandler(Thread-26, started 139992432494336)>
n1.osvcd.listener stop <ClientHandler(Thread-50, started 139992412727040)>
n1.osvcd.listener stop <ClientHandler(Thread-1068, started 139992424101632)>
...
  • Loading branch information...
cvaroqui committed Jul 1, 2019
1 parent 954e155 commit 770791f0445e3a96ab7a17d317de4f97bc5cc1ac
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/osvcd_lsnr.py
@@ -584,6 +584,14 @@ def __init__(self, parent, conn, addr, encrypted, scheme, tls, tls_context):
self.usr_grants = {}
self.events_counter = 0

def __str__(self):
return "client handler thread (client addr: %s, usr: %s, auth: %s, scheme: %s)" % (
self.addr[0],
self.usr.svcname if self.usr else self.usr,
self.usr_auth,
self.scheme
)

def run(self):
try:
close = True

0 comments on commit 770791f

Please sign in to comment.
You can’t perform that action at this time.