Commit 8c9c1f09 authored by ibuler's avatar ibuler

[Update] 优化

parent f61d0d6e
...@@ -271,7 +271,7 @@ class InteractiveServer: ...@@ -271,7 +271,7 @@ class InteractiveServer:
assets, total = app_service.get_user_assets_paging( assets, total = app_service.get_user_assets_paging(
self.client.user, offset=self.offset, limit=self.limit self.client.user, offset=self.offset, limit=self.limit
) )
logger.info('Get user assets paging async: {}'.format(len(assets))) logger.debug('Get user assets paging async: {}'.format(len(assets)))
if not assets: if not assets:
logger.info('Get user assets paging async finished.') logger.info('Get user assets paging async finished.')
self.finish = True self.finish = True
......
...@@ -90,7 +90,7 @@ class SSHInterface(paramiko.ServerInterface): ...@@ -90,7 +90,7 @@ class SSHInterface(paramiko.ServerInterface):
logger.debug("Public key auth <%s> failed, try to password" % username) logger.debug("Public key auth <%s> failed, try to password" % username)
return paramiko.AUTH_FAILED return paramiko.AUTH_FAILED
else: else:
logger.debug("Public key auth <%s> success" % username) logger.info("Public key auth <%s> success" % username)
if self.otp_auth: if self.otp_auth:
return paramiko.AUTH_PARTIALLY_SUCCESSFUL return paramiko.AUTH_PARTIALLY_SUCCESSFUL
return paramiko.AUTH_SUCCESSFUL return paramiko.AUTH_SUCCESSFUL
...@@ -149,14 +149,14 @@ class SSHInterface(paramiko.ServerInterface): ...@@ -149,14 +149,14 @@ class SSHInterface(paramiko.ServerInterface):
return 0 return 0
def check_port_forward_request(self, address, port): def check_port_forward_request(self, address, port):
logger.info( logger.debug(
"Check channel port forward request: %s %s" % (address, port) "Check channel port forward request: %s %s" % (address, port)
) )
self.event.set() self.event.set()
return False return False
def check_channel_request(self, kind, chan_id): def check_channel_request(self, kind, chan_id):
logger.info("Check channel request: %s %d" % (kind, chan_id)) logger.debug("Check channel request: %s %d" % (kind, chan_id))
client = self.connection.new_client(chan_id) client = self.connection.new_client(chan_id)
client.request.kind = kind client.request.kind = kind
return paramiko.OPEN_SUCCEEDED return paramiko.OPEN_SUCCEEDED
...@@ -188,7 +188,7 @@ class SSHInterface(paramiko.ServerInterface): ...@@ -188,7 +188,7 @@ class SSHInterface(paramiko.ServerInterface):
def check_channel_pty_request( def check_channel_pty_request(
self, channel, term, width, height, self, channel, term, width, height,
pixelwidth, pixelheight, modes): pixelwidth, pixelheight, modes):
logger.info("Check channel pty request: %s %s %s %s %s" % logger.debug("Check channel pty request: %s %s %s %s %s" %
(term, width, height, pixelwidth, pixelheight)) (term, width, height, pixelwidth, pixelheight))
client = self.connection.get_client(channel) client = self.connection.get_client(channel)
client.request.type = 'pty' client.request.type = 'pty'
...@@ -201,13 +201,13 @@ class SSHInterface(paramiko.ServerInterface): ...@@ -201,13 +201,13 @@ class SSHInterface(paramiko.ServerInterface):
return True return True
def check_channel_shell_request(self, channel): def check_channel_shell_request(self, channel):
logger.info("Check channel shell request: %s" % channel.get_id()) logger.debug("Check channel shell request: %s" % channel.get_id())
client = self.connection.get_client(channel) client = self.connection.get_client(channel)
client.request.meta['shell'] = True client.request.meta['shell'] = True
return True return True
def check_channel_subsystem_request(self, channel, name): def check_channel_subsystem_request(self, channel, name):
logger.info("Check channel subsystem request: %s" % name) logger.debug("Check channel subsystem request: %s" % name)
client = self.connection.get_client(channel) client = self.connection.get_client(channel)
client.request.type = 'subsystem' client.request.type = 'subsystem'
client.request.meta['subsystem'] = name client.request.meta['subsystem'] = name
...@@ -228,7 +228,7 @@ class SSHInterface(paramiko.ServerInterface): ...@@ -228,7 +228,7 @@ class SSHInterface(paramiko.ServerInterface):
def check_channel_x11_request(self, channel, single_connection, def check_channel_x11_request(self, channel, single_connection,
auth_protocol, auth_cookie, screen_number): auth_protocol, auth_cookie, screen_number):
logger.info("Check channel x11 request %s %s %s %s" % logger.debug("Check channel x11 request %s %s %s %s" %
(single_connection, auth_protocol, (single_connection, auth_protocol,
auth_cookie, screen_number)) auth_cookie, screen_number))
client = self.connection.get_client(channel) client = self.connection.get_client(channel)
......
...@@ -59,7 +59,6 @@ class Connection(object): ...@@ -59,7 +59,6 @@ class Connection(object):
client.close() client.close()
self.__class__.clients_num -= 1 self.__class__.clients_num -= 1
del self.clients[tid] del self.clients[tid]
del client
logger.info("Client {} leave, total {} now".format( logger.info("Client {} leave, total {} now".format(
client, self.__class__.clients_num client, self.__class__.clients_num
)) ))
...@@ -85,7 +84,6 @@ class Connection(object): ...@@ -85,7 +84,6 @@ class Connection(object):
return return
connection.close() connection.close()
del cls.connections[cid] del cls.connections[cid]
del connection
@classmethod @classmethod
def get_connection(cls, cid): def get_connection(cls, cid):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment