Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
webssh
Overview
Overview
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
郑天保
webssh
Commits
fdf0f88e
Commit
fdf0f88e
authored
Apr 11, 2018
by
Sheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed method
parent
0b4e41b1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
main.py
main.py
+2
-2
policy.py
policy.py
+2
-2
No files found.
main.py
View file @
fdf0f88e
import
logging
import
logging
import
tornado.web
import
tornado.web
import
tornado.ioloop
from
tornado.ioloop
import
IOLoop
from
tornado.options
import
parse_command_line
,
options
from
tornado.options
import
parse_command_line
,
options
from
handler
import
IndexHandler
,
WsockHandler
from
handler
import
IndexHandler
,
WsockHandler
from
settings
import
get_application_settings
from
settings
import
get_application_settings
...
@@ -16,7 +16,7 @@ def main():
...
@@ -16,7 +16,7 @@ def main():
(
r'/ws'
,
WsockHandler
)
(
r'/ws'
,
WsockHandler
)
]
]
loop
=
IOLoop
.
current
()
loop
=
tornado
.
ioloop
.
IOLoop
.
current
()
app
=
tornado
.
web
.
Application
(
handlers
,
**
settings
)
app
=
tornado
.
web
.
Application
(
handlers
,
**
settings
)
app
.
_loop
=
loop
app
.
_loop
=
loop
app
.
listen
(
options
.
port
,
options
.
address
)
app
.
listen
(
options
.
port
,
options
.
address
)
...
...
policy.py
View file @
fdf0f88e
...
@@ -41,7 +41,7 @@ class AutoAddPolicy(paramiko.client.MissingHostKeyPolicy):
...
@@ -41,7 +41,7 @@ class AutoAddPolicy(paramiko.client.MissingHostKeyPolicy):
"""
"""
lock
=
threading
.
Lock
()
lock
=
threading
.
Lock
()
def
is_missing_host_key
s
(
self
,
client
,
hostname
,
key
):
def
is_missing_host_key
(
self
,
client
,
hostname
,
key
):
k
=
client
.
_host_keys
.
lookup
(
hostname
)
k
=
client
.
_host_keys
.
lookup
(
hostname
)
if
k
is
None
:
if
k
is
None
:
return
True
return
True
...
@@ -53,7 +53,7 @@ class AutoAddPolicy(paramiko.client.MissingHostKeyPolicy):
...
@@ -53,7 +53,7 @@ class AutoAddPolicy(paramiko.client.MissingHostKeyPolicy):
def
missing_host_key
(
self
,
client
,
hostname
,
key
):
def
missing_host_key
(
self
,
client
,
hostname
,
key
):
with
self
.
lock
:
with
self
.
lock
:
if
self
.
is_missing_host_key
s
(
client
,
hostname
,
key
):
if
self
.
is_missing_host_key
(
client
,
hostname
,
key
):
keytype
=
key
.
get_name
()
keytype
=
key
.
get_name
()
logging
.
info
(
logging
.
info
(
'Adding {} host key for {}'
.
format
(
keytype
,
hostname
)
'Adding {} host key for {}'
.
format
(
keytype
,
hostname
)
...
...
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