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
bcfeaa2d
Commit
bcfeaa2d
authored
Oct 24, 2017
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Forget
parent
af0cb201
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
interactive.py
coco/interactive.py
+3
-3
session.py
coco/session.py
+1
-1
No files found.
coco/interactive.py
View file @
bcfeaa2d
...
@@ -128,8 +128,8 @@ class InteractiveServer:
...
@@ -128,8 +128,8 @@ class InteractiveServer:
pass
pass
def
search_and_proxy
(
self
,
opt
,
from_result
=
False
):
def
search_and_proxy
(
self
,
opt
,
from_result
=
False
):
asset
=
Asset
(
id
=
1
,
hostname
=
"testserver"
,
ip
=
"1
92.168.244.164"
,
port
=
22
)
asset
=
Asset
(
id
=
1
,
hostname
=
"testserver"
,
ip
=
"1
23.57.183.135"
,
port
=
80
22
)
system_user
=
SystemUser
(
id
=
2
,
username
=
"
root"
,
password
=
"redhat
"
,
name
=
"web"
)
system_user
=
SystemUser
(
id
=
2
,
username
=
"
web"
,
password
=
"redhat123
"
,
name
=
"web"
)
self
.
proxy
(
asset
,
system_user
)
self
.
proxy
(
asset
,
system_user
)
def
proxy
(
self
,
asset
,
system_user
):
def
proxy
(
self
,
asset
,
system_user
):
...
@@ -148,7 +148,7 @@ class InteractiveServer:
...
@@ -148,7 +148,7 @@ class InteractiveServer:
opt
=
self
.
get_choice
()
opt
=
self
.
get_choice
()
self
.
dispatch
(
opt
)
self
.
dispatch
(
opt
)
except
socket
.
error
as
e
:
except
socket
.
error
as
e
:
logger
.
error
(
"
C
ocket error
%
s"
%
e
)
logger
.
error
(
"
S
ocket error
%
s"
%
e
)
break
break
self
.
close
()
self
.
close
()
...
...
coco/session.py
View file @
bcfeaa2d
...
@@ -91,7 +91,7 @@ class Session:
...
@@ -91,7 +91,7 @@ class Session:
elif
sock
==
self
.
client
:
elif
sock
==
self
.
client
:
if
len
(
data
)
==
0
:
if
len
(
data
)
==
0
:
for
watcher
in
self
.
watchers
+
self
.
sharers
:
for
watcher
in
self
.
watchers
+
self
.
sharers
:
watcher
.
send
(
"Client
%
s close the session"
%
self
.
client
)
watcher
.
send
(
b
"Client
%
s close the session"
%
self
.
client
)
self
.
close
()
self
.
close
()
break
break
self
.
server
.
send
(
data
)
self
.
server
.
send
(
data
)
...
...
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