Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
coco
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
coco
Commits
8c9c1f09
Commit
8c9c1f09
authored
Dec 24, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 优化
parent
f61d0d6e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
10 deletions
+8
-10
interactive.py
coco/interactive.py
+1
-1
interface.py
coco/interface.py
+7
-7
models.py
coco/models.py
+0
-2
No files found.
coco/interactive.py
View file @
8c9c1f09
...
...
@@ -271,7 +271,7 @@ class InteractiveServer:
assets
,
total
=
app_service
.
get_user_assets_paging
(
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
:
logger
.
info
(
'Get user assets paging async finished.'
)
self
.
finish
=
True
...
...
coco/interface.py
View file @
8c9c1f09
...
...
@@ -90,7 +90,7 @@ class SSHInterface(paramiko.ServerInterface):
logger
.
debug
(
"Public key auth <
%
s> failed, try to password"
%
username
)
return
paramiko
.
AUTH_FAILED
else
:
logger
.
debug
(
"Public key auth <
%
s> success"
%
username
)
logger
.
info
(
"Public key auth <
%
s> success"
%
username
)
if
self
.
otp_auth
:
return
paramiko
.
AUTH_PARTIALLY_SUCCESSFUL
return
paramiko
.
AUTH_SUCCESSFUL
...
...
@@ -149,14 +149,14 @@ class SSHInterface(paramiko.ServerInterface):
return
0
def
check_port_forward_request
(
self
,
address
,
port
):
logger
.
info
(
logger
.
debug
(
"Check channel port forward request:
%
s
%
s"
%
(
address
,
port
)
)
self
.
event
.
set
()
return
False
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
.
request
.
kind
=
kind
return
paramiko
.
OPEN_SUCCEEDED
...
...
@@ -188,7 +188,7 @@ class SSHInterface(paramiko.ServerInterface):
def
check_channel_pty_request
(
self
,
channel
,
term
,
width
,
height
,
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
))
client
=
self
.
connection
.
get_client
(
channel
)
client
.
request
.
type
=
'pty'
...
...
@@ -201,13 +201,13 @@ class SSHInterface(paramiko.ServerInterface):
return
True
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
.
request
.
meta
[
'shell'
]
=
True
return
True
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
.
request
.
type
=
'subsystem'
client
.
request
.
meta
[
'subsystem'
]
=
name
...
...
@@ -228,7 +228,7 @@ class SSHInterface(paramiko.ServerInterface):
def
check_channel_x11_request
(
self
,
channel
,
single_connection
,
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
,
auth_cookie
,
screen_number
))
client
=
self
.
connection
.
get_client
(
channel
)
...
...
coco/models.py
View file @
8c9c1f09
...
...
@@ -59,7 +59,6 @@ class Connection(object):
client
.
close
()
self
.
__class__
.
clients_num
-=
1
del
self
.
clients
[
tid
]
del
client
logger
.
info
(
"Client {} leave, total {} now"
.
format
(
client
,
self
.
__class__
.
clients_num
))
...
...
@@ -85,7 +84,6 @@ class Connection(object):
return
connection
.
close
()
del
cls
.
connections
[
cid
]
del
connection
@classmethod
def
get_connection
(
cls
,
cid
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment