Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
3pia
VISPA
VISPA web
Commits
da27efbb
Commit
da27efbb
authored
Apr 12, 2018
by
murban
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set python hardcoded on version 2
parent
510d999e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
vispa/workspace.py
vispa/workspace.py
+10
-10
No files found.
vispa/workspace.py
View file @
da27efbb
...
...
@@ -155,7 +155,7 @@ class LocalConnectionImpl(object):
_local_connection_feeder
=
None
def
__init__
(
self
,
command
,
**
kwargs
):
if
command
[
0
]
==
"python"
and
not
sys
.
platform
.
startswith
(
"java"
):
if
command
[
0
]
==
"python
2
"
and
not
sys
.
platform
.
startswith
(
"java"
):
command
[
0
]
=
sys
.
executable
logger
.
info
(
"local connection: %s"
%
" "
.
join
(
command
))
self
.
__proc
=
subprocess
.
Popen
(
command
,
stdin
=
subprocess
.
PIPE
,
...
...
@@ -285,7 +285,7 @@ class SSHConnectionImpl(object):
else
:
if
missing_host_key_policy
!=
"reject"
:
import
warnings
warnings
.
warn
(
"Unknown missing host key policy: "
+
warnings
.
warn
(
"Unknown missing host key policy: "
+
missing_host_key_policy
)
self
.
__client
.
set_missing_host_key_policy
(
paramiko
.
RejectPolicy
())
...
...
@@ -451,7 +451,7 @@ class Connection(object):
self
.
__userid
=
userid
self
.
__workspaceid
=
workspaceid
self
.
__host
=
host
self
.
__python
=
kwargs
.
get
(
'python'
,
'python'
)
or
"python"
self
.
__python
=
kwargs
.
get
(
'python'
,
'python
2
'
)
or
"python
2
"
self
.
__username
=
kwargs
.
get
(
'username'
,
None
)
self
.
__server
=
None
self
.
__tempdir
=
kwargs
.
get
(
"tempdir"
,
""
)
...
...
@@ -482,16 +482,16 @@ class Connection(object):
MAGIC_STRING
=
"START_RPYC"
.
encode
(
"ascii"
)
MAGIC_STRING_LENGTH
=
len
(
MAGIC_STRING
)
buf
=
b
''
while
True
:
# fill buffer to needed size
remaining
=
MAGIC_STRING_LENGTH
-
len
(
buf
)
buf
+=
self
.
_connection
.
stdout
.
read
(
remaining
)
# compare
if
buf
==
MAGIC_STRING
:
return
# jump to next S
try
:
buf
=
buf
[
buf
.
index
(
MAGIC_STRING
[
0
],
1
):]
...
...
@@ -694,7 +694,7 @@ class Connection(object):
def
rpyc
(
self
):
return
self
.
__rpyc
def
errors
(
self
):
for
i
,
line
in
enumerate
(
self
.
_connection
.
stderr
):
line
=
line
.
rstrip
()
...
...
@@ -761,7 +761,7 @@ class ConnectionPool(object):
key
=
(
user
.
id
,
workspace
.
id
)
if
key
in
self
.
_connections
and
self
.
_connections
[
key
].
active
():
logger
.
debug
(
"workspace already conected: %d - %d"
%
"workspace already conected: %d - %d"
%
(
user
.
id
,
workspace
.
id
))
self
.
_connections
[
key
].
send_status
()
return
self
.
_connections
[
key
]
...
...
@@ -791,7 +791,7 @@ class ConnectionPool(object):
def
clear
(
self
,
user
=
None
,
workspace
=
None
):
uid
=
user
.
id
if
type
(
user
)
==
User
else
user
wid
=
workspace
.
id
if
type
(
workspace
)
==
Workspace
else
workspace
for
_uid
,
_wid
in
self
.
_connections
.
keys
():
for
_uid
,
_wid
in
self
.
_connections
.
keys
():
if
uid
and
uid
!=
_uid
:
continue
if
wid
and
wid
!=
_wid
:
...
...
@@ -803,7 +803,7 @@ class ConnectionPool(object):
c
=
self
.
_connections
[
key
]
del
self
.
_connections
[
key
]
c
.
close
()
return
# not found, send topic anyway
...
...
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