Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
client
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
0
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
df2cfe8b
authored
Sep 04, 2014
by
Csók Tamás
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client: flake8 correction
parent
b2bf7691
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
dist/cloud_connect_from_linux.py
+8
-3
src/python/cloud_connect_from_linux.py
+8
-3
No files found.
dist/cloud_connect_from_linux.py
View file @
df2cfe8b
...
...
@@ -26,7 +26,8 @@ def connect(vm):
vm.password -- Password used for the connection
"""
if
vm
.
protocol
==
"SSH"
:
command
=
"sshpass -p
%
s ssh -p
%
s -o StrictHostKeyChecking=no
%
s@
%
s"
%
(
vm
.
password
,
vm
.
port
,
vm
.
user
,
vm
.
host
)
command
=
"sshpass -p
%
s ssh -p
%
s"
%
(
vm
.
password
,
vm
.
port
)
+
" -o StrictHostKeyChecking=no
%
s@
%
s"
%
(
vm
.
user
,
vm
.
host
)
subprocess
.
call
(
command
,
shell
=
True
)
elif
vm
.
protocol
in
(
"NX"
,
"RDP"
):
server
=
"
%
s:
%
s"
%
(
vm
.
host
,
vm
.
port
)
...
...
@@ -38,14 +39,18 @@ def connect(vm):
found
=
True
break
if
not
found
:
config_file
=
"
%
s
%
s
%
s"
%
(
os
.
path
.
expanduser
(
"~/.remmina/"
),
str
(
int
(
time
.
time
()
*
1000
)),
".remmina"
)
config_file
=
"
%
s
%
s
%
s"
%
(
os
.
path
.
expanduser
(
"~/.remmina/"
),
str
(
int
(
time
.
time
()
*
1000
)),
".remmina"
)
password
=
subprocess
.
check_output
([
"remminapasswd"
,
vm
.
password
])
f
=
open
(
config_file
,
'w'
)
if
vm
.
protocol
==
"NX"
:
f
.
write
(
NX_template
)
else
:
f
.
write
(
RDP_template
)
f
.
write
(
"name=
%
s:
%
s
\n
protocol=
%
s
\n
server=
%
s
\n
username=
%
s
\n
password=
%
s
\n
"
%
(
vm
.
protocol
,
server
,
vm
.
protocol
,
server
,
vm
.
user
,
password
))
f
.
write
(
"name=
%
s:
%
s
\n
"
%
(
vm
.
protocol
,
server
)
+
"protocol=
%
s
\n
server=
%
s
\n
"
%
(
vm
.
protocol
,
server
)
+
"username=
%
s
\n
password=
%
s
\n
"
%
(
vm
.
user
,
password
))
f
.
close
()
subprocess
.
call
([
"remmina"
,
"-c"
,
config_file
])
...
...
src/python/cloud_connect_from_linux.py
View file @
df2cfe8b
...
...
@@ -26,7 +26,8 @@ def connect(vm):
vm.password -- Password used for the connection
"""
if
vm
.
protocol
==
"SSH"
:
command
=
"sshpass -p
%
s ssh -p
%
s -o StrictHostKeyChecking=no
%
s@
%
s"
%
(
vm
.
password
,
vm
.
port
,
vm
.
user
,
vm
.
host
)
command
=
"sshpass -p
%
s ssh -p
%
s"
%
(
vm
.
password
,
vm
.
port
)
+
" -o StrictHostKeyChecking=no
%
s@
%
s"
%
(
vm
.
user
,
vm
.
host
)
subprocess
.
call
(
command
,
shell
=
True
)
elif
vm
.
protocol
in
(
"NX"
,
"RDP"
):
server
=
"
%
s:
%
s"
%
(
vm
.
host
,
vm
.
port
)
...
...
@@ -38,14 +39,18 @@ def connect(vm):
found
=
True
break
if
not
found
:
config_file
=
"
%
s
%
s
%
s"
%
(
os
.
path
.
expanduser
(
"~/.remmina/"
),
str
(
int
(
time
.
time
()
*
1000
)),
".remmina"
)
config_file
=
"
%
s
%
s
%
s"
%
(
os
.
path
.
expanduser
(
"~/.remmina/"
),
str
(
int
(
time
.
time
()
*
1000
)),
".remmina"
)
password
=
subprocess
.
check_output
([
"remminapasswd"
,
vm
.
password
])
f
=
open
(
config_file
,
'w'
)
if
vm
.
protocol
==
"NX"
:
f
.
write
(
NX_template
)
else
:
f
.
write
(
RDP_template
)
f
.
write
(
"name=
%
s:
%
s
\n
protocol=
%
s
\n
server=
%
s
\n
username=
%
s
\n
password=
%
s
\n
"
%
(
vm
.
protocol
,
server
,
vm
.
protocol
,
server
,
vm
.
user
,
password
))
f
.
write
(
"name=
%
s:
%
s
\n
"
%
(
vm
.
protocol
,
server
)
+
"protocol=
%
s
\n
server=
%
s
\n
"
%
(
vm
.
protocol
,
server
)
+
"username=
%
s
\n
password=
%
s
\n
"
%
(
vm
.
user
,
password
))
f
.
close
()
subprocess
.
call
([
"remmina"
,
"-c"
,
config_file
])
...
...
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