Commit b2bf7691 by Csók Tamás

client: linux version is made up to date

parent 3dca7160
...@@ -7,5 +7,5 @@ Comment=Tool to use IK Cloud ...@@ -7,5 +7,5 @@ Comment=Tool to use IK Cloud
Exec=cloud2 %u Exec=cloud2 %u
Icon=/usr/share/icons/cloud.svg Icon=/usr/share/icons/cloud.svg
Terminal=true Terminal=true
MimeType=x-scheme-handler/rdp;x-scheme-handler/nx;x-scheme-handler/ssh; MimeType=x-scheme-handler/circle;
Categories=Utility;Application; Categories=Utility;Application;
#!/usr/bin/python #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
## """
# A cloudban létrehozott virtuális gépekhez történő kapcsolódást segítő program Main program of the Client written for CIRCLE Cloud.
## The Client job is to help the ease of use of the cloud system.
"""
from selenium import webdriver
from selenium.webdriver.common.by import By import platform
from selenium.webdriver.support.ui import WebDriverWait import argparse
from selenium.webdriver.support import expected_conditions as EC try:
import platform, argparse, sys, time from selenium import webdriver
from selenium.webdriver.common.by import By
## from selenium.webdriver.support.ui import WebDriverWait
# Paraméterek átadására használt struktúra from selenium.webdriver.support import expected_conditions as EC
# state A virtuális gép állapota, azt figyeljük, hogy fut-e except ImportError:
# protocol SSH, NX és RDP lehetséges pass
# host A virtuális gép címe
# port Ezen a porton csatlakozunk a virtuális géphez
# user Csatlakozáshoz használt név
# password Csatlakozáshoz használt jelszó
class Struct: class Struct:
"""
A struct used for parameter passing
Keyword arguments:
state -- State of the Virtual Computer (running, etc..)
protocol -- SSH, NX and RDP possible
host -- Address of the Virtual Computer
port -- The port where we can access the Virtual Computer
user -- Username used for the connection
password -- Password used for the connection
"""
pass pass
##
# Argument parser, argparse modulon alapszik
# @return args
#
def pars_arguments(): def parse_arguments():
parser = argparse.ArgumentParser(); """
parser.add_argument("uri", type=str, help="Specific schema handler", nargs='?', default=None) Argument parser, based on the argparse module
Keyword arguments:
@return args -- arguments given by console
"""
parser = argparse.ArgumentParser()
parser.add_argument(
"uri", type=str, help="Specific schema handler", nargs='?',
default=None)
parser.add_argument("-u", "--username", type=str) parser.add_argument("-u", "--username", type=str)
parser.add_argument("-p", "--password", type=str) parser.add_argument("-p", "--password", type=str)
parser.add_argument("-d", "--driver", help="Select webdriver. Aside from Firefox, you have to install first the proper driver.", \ parser.add_argument(
type=str, choices=['firefox', 'chrome', 'ie', 'opera', 'safari'], default="firefox") "-d", "--driver",
parser.add_argument("-o", "--old", help="Use old interface", action="store_true") help="Select webdriver. Aside from Firefox, you have to install "
args = parser.parse_args(); + "first the proper driver.", type=str,
choices=['firefox', 'chrome', 'ie', 'opera'],
default="firefox")
args = parser.parse_args()
return args return args
class Browser: class Browser:
## """
# Browser inicializálás Browser initialisation
# @param args Az args.driver paraméterrel meghatározhatjuk, melyik böngészőt akarjuk használni.
# Keyword arguments:
@param args -- args.driver tells us which installed browser
we want to use with selenium.
"""
def __init__(self, args): def __init__(self, args):
self.args = args self.args = args
if args.driver == "firefox": if args.driver == "firefox":
...@@ -54,14 +73,12 @@ class Browser: ...@@ -54,14 +73,12 @@ class Browser:
self.driver = webdriver.Ie() self.driver = webdriver.Ie()
elif args.driver == "opera": elif args.driver == "opera":
self.driver = webdriver.Opera() self.driver = webdriver.Opera()
elif args.driver == "safari":
self.driver = webdriver.Safari()
self.driver.implicitly_wait(10) self.driver.implicitly_wait(10)
##
# Címtáras beléptetés a parancssorban megadott paraméterek alapján
#
def login(self): def login(self):
"""
Eduid login based on the given console arguments
"""
driver = self.driver driver = self.driver
args = self.args args = self.args
if args.username is not None: if args.username is not None:
...@@ -71,51 +88,36 @@ class Browser: ...@@ -71,51 +88,36 @@ class Browser:
driver.find_element_by_name("j_password").clear() driver.find_element_by_name("j_password").clear()
driver.find_element_by_name("j_password").send_keys(args.password) driver.find_element_by_name("j_password").send_keys(args.password)
if args.username is not None and args.password is not None: if args.username is not None and args.password is not None:
driver.find_element_by_css_selector("input[type='submit']").click() driver.find_element_by_css_selector(
"input[type='submit']").click()
##
# A régi webes felület használata
# @return vm Virtuális gép csatlakozásához szükséges paraméterek
#
def old_main(self):
vm = Struct()
driver = self.driver
driver.maximize_window()
driver.get("https://cloud.ik.bme.hu/info/")
driver.find_element_by_css_selector("a[href*='/login/']").click()
self.login()
vm.state, vm.protocol = "", "NONE"
try:
while vm.state.upper()[:3] not in ("FUT", "RUN"):
element = WebDriverWait(driver, 7200).until(EC.presence_of_element_located((By.CSS_SELECTOR, "input.hidden-password.shown[type='text']")))
vm.password = element.get_attribute("value")
vm.state = driver.find_element_by_css_selector("#state > div > p").text
vm.protocol = driver.find_element_by_css_selector("#vm-credentials > div > table > tbody > tr:nth-child(1) > td").text
vm.host,vm.port = driver.find_element_by_css_selector("#vm-credentials > div > table > tbody > tr:nth-child(2) > td").text.split(':')
vm.user = driver.find_element_by_css_selector("#vm-credentials > div > table > tbody > tr:nth-child(4) > td").text
driver.find_element_by_css_selector("a[href*='/logout/']").click()
except:
print "Browser session timed out!"
return vm
##
# Az új webes felület használata
# @return vm Virtuális gép csatlakozásához szükséges paraméterek
#
def main(self): def main(self):
"""
Use of the https://cloud.bme.hu/
Keyword arguments:
@return vm -- Necessarily parameters to connect
to the Virtual Machine
"""
vm = Struct() vm = Struct()
driver = self.driver driver = self.driver
driver.maximize_window() driver.maximize_window()
driver.get("https://pc3.szgt.uni-miskolc.hu/") driver.get("https://cloud.bme.hu/")
#driver.find_element_by_css_selector("a[href*='/login/']").click() # driver.find_element_by_css_selector("a[href*='/login/']").click()
#self.login() # self.login()
vm.state, vm.protocol = "", "NONE" vm.state, vm.protocol = "", "NONE"
try: try:
while vm.state.upper()[:3] not in ("FUT", "RUN"): while vm.state.upper()[:3] not in ("FUT", "RUN"):
element = WebDriverWait(driver,7200).until(EC.presence_of_element_located((By.CSS_SELECTOR, "#vm-details-pw-eye.icon-eye-close"))) WebDriverWait(driver, 7200).until(
vm.state = driver.find_element_by_css_selector("#vm-details-state > span").text EC.presence_of_element_located((
#cl: connection string converted to list By.CSS_SELECTOR,
cl = driver.find_element_by_css_selector("#vm-details-connection-string").get_attribute("value").split() "#vm-details-pw-eye.fa.fa-eye-slash")))
vm.state = driver.find_element_by_css_selector(
"#vm-details-state > span").text
# cl: connection string converted to list
cl = driver.find_element_by_css_selector(
"#vm-details-connection-string").get_attribute(
"value").split()
if cl[0] == "sshpass": if cl[0] == "sshpass":
vm.protocol = "SSH" vm.protocol = "SSH"
vm.user, vm.host = cl[6].split("@") vm.user, vm.host = cl[6].split("@")
...@@ -127,36 +129,35 @@ class Browser: ...@@ -127,36 +129,35 @@ class Browser:
driver.find_element_by_css_selector("a[href*='/logout/']").click() driver.find_element_by_css_selector("a[href*='/logout/']").click()
except: except:
print "Browser session timed out!" print "Browser session timed out!"
raise
return vm return vm
##
# Főprogram
# beolvassuk a paramétereket
# megnyitjuk a kiválasztott böngészőben a weboldalt
# bejelentkezünk a címtárba
# kiválasztjuk a futtatni kívánt klienst
# kapcsolódunk a klienshez
def main(): def main():
args = pars_arguments() """
if args.uri is not None: Main program
vm = Struct() """
vm.protocol, vm.user, vm.password, vm.host, vm.port = args.uri.split(':',4) try:
vm.protocol = vm.protocol.upper() args = parse_arguments()
vm.state = "RUN" if args.uri is not None:
else: vm = Struct()
browser = Browser(args) x, vm.protocol, vm.user, vm.password, vm.host, vm.port = \
if args.old: args.uri.split(':', 5)
vm = browser.old_main() vm.protocol = vm.protocol.upper()
vm.state = "RUN"
else: else:
browser = Browser(args)
vm = browser.main() vm = browser.main()
browser.driver.quit() browser.driver.quit()
if platform.system() == "Linux": if platform.system() == "Linux":
from cloud_connect_from_linux import connect from cloud_connect_from_linux import connect
elif platform.system() == "Windows": elif platform.system() == "Windows":
from cloud_connect_from_windows import connect from cloud_connect_from_windows import connect
if vm.state.upper()[:3] in ("FUT", "RUN"): if vm.state.upper()[:3] in ("FUT", "RUN"):
connect(vm) connect(vm)
except:
print "Unknown error occurred! Please contact the developers!"
if __name__ == "__main__": if __name__ == "__main__":
main() main()
#!/usr/bin/python #!/usr/bin/env python
# -*- coding: utf-8 -*-
import cloud import cloud
...@@ -7,4 +8,3 @@ if __name__ == '__main__': ...@@ -7,4 +8,3 @@ if __name__ == '__main__':
cloud.main() cloud.main()
finally: finally:
pass pass
#!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
## """
# Távoli klienshez csatlakozás linux OS alól Configuration of the Linux specific tools to enhance the ease of use
## of the CIRCLE cloud. Handles the auto launch and auto configuration
of these specific connectivity programs.
"""
import time
import os
import subprocess
import glob
import sys, os, time, subprocess, glob
##
# A távoli klienshez csatlakozás valósítja meg
# NX és RDP esetén a remmina programot hívja meg. Ha a remmina-ban még nem szerepel
# a kliens, a program elkészíti az indításhoz szükséges profilt.
# @param vm Paraméterek a csatlakozáshoz
# vm.protocol SSH, NX és RDP lehetséges
# vm.host A virtuális gép címe
# vm.port Ezen a porton csatlakozunk a virtuális géphez
# vm.user Csatlakozáshoz használt név
# vm.password Csatlakozáshoz használt jelszó
#
def connect(vm): def connect(vm):
"""
Handles to connection to the Virtual Machines from the local
machine
Keyword arguments:
vm.protocol -- SSH, NX and RDP possible
vm.host -- Address of the Virtual Computer
vm.port -- The port where we can access the Virtual Computer
vm.user -- Username used for the connection
vm.password -- Password used for the connection
"""
if vm.protocol == "SSH": 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 -o StrictHostKeyChecking=no %s@%s" % (vm.password, vm.port, vm.user, vm.host)
subprocess.call(command, shell=True) subprocess.call(command, shell=True)
...@@ -42,18 +49,12 @@ def connect(vm): ...@@ -42,18 +49,12 @@ def connect(vm):
f.close() f.close()
subprocess.call(["remmina", "-c", config_file]) subprocess.call(["remmina", "-c", config_file])
NX_template = """[remmina] NX_template = """[remmina]
ssh_auth=0 ssh_auth=0
quality=2 quality=2
disableencryption=0 disableencryption=0
ssh_charset=
ssh_privatekey=
resolution=
group=
ssh_loopback=0 ssh_loopback=0
exec=
ssh_username=
ssh_server=
ssh_enabled=0 ssh_enabled=0
nx_privatekey= nx_privatekey=
showcursor=0 showcursor=0
...@@ -65,24 +66,12 @@ viewmode=4 ...@@ -65,24 +66,12 @@ viewmode=4
RDP_template = """[remmina] RDP_template = """[remmina]
disableclipboard=0 disableclipboard=0
ssh_auth=0 ssh_auth=0
clientname=
quality=2 quality=2
ssh_charset=
ssh_privatekey=
console=0 console=0
resolution=
group=
ssh_loopback=0 ssh_loopback=0
shareprinter=0 shareprinter=0
ssh_username=
ssh_server=
security=
execpath=
sound=off sound=off
exec=
ssh_enabled=0 ssh_enabled=0
sharefolder=
domain=
colordepth=24 colordepth=24
window_maximize=1 window_maximize=1
viewmode=4 viewmode=4
......
# -*- coding: utf-8 -*-
##
# Távoli klienshez csatlakozás windows OS alól
##
##
# A távoli klienshez csatlakozás valósítja majd meg windows alól
# @param vm Paraméterek a csatlakozáshoz
# vm.protocol SSH, NX és RDP lehetséges
# vm.host A virtuális gép címe
# vm.port Ezen a porton csatlakozunk a virtuális géphez
# vm.user Csatlakozáshoz használt név
# vm.password Csatlakozáshoz használt jelszó
#
def connect(vm):
pass
#!/usr/bin/python #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
## """
# A cloudban létrehozott virtuális gépekhez történő kapcsolódást segítő program Main program of the Client written for CIRCLE Cloud.
## The Client job is to help the ease of use of the cloud system.
"""
from selenium import webdriver
from selenium.webdriver.common.by import By import platform
from selenium.webdriver.support.ui import WebDriverWait import argparse
from selenium.webdriver.support import expected_conditions as EC try:
import platform, argparse, sys, time from selenium import webdriver
from selenium.webdriver.common.by import By
## from selenium.webdriver.support.ui import WebDriverWait
# Paraméterek átadására használt struktúra from selenium.webdriver.support import expected_conditions as EC
# state A virtuális gép állapota, azt figyeljük, hogy fut-e except ImportError:
# protocol SSH, NX és RDP lehetséges pass
# host A virtuális gép címe
# port Ezen a porton csatlakozunk a virtuális géphez
# user Csatlakozáshoz használt név
# password Csatlakozáshoz használt jelszó
class Struct: class Struct:
"""
A struct used for parameter passing
Keyword arguments:
state -- State of the Virtual Computer (running, etc..)
protocol -- SSH, NX and RDP possible
host -- Address of the Virtual Computer
port -- The port where we can access the Virtual Computer
user -- Username used for the connection
password -- Password used for the connection
"""
pass pass
##
# Argument parser, argparse modulon alapszik
# @return args
#
def pars_arguments(): def parse_arguments():
parser = argparse.ArgumentParser(); """
parser.add_argument("uri", type=str, help="Specific schema handler", nargs='?', default=None) Argument parser, based on the argparse module
Keyword arguments:
@return args -- arguments given by console
"""
parser = argparse.ArgumentParser()
parser.add_argument(
"uri", type=str, help="Specific schema handler", nargs='?',
default=None)
parser.add_argument("-u", "--username", type=str) parser.add_argument("-u", "--username", type=str)
parser.add_argument("-p", "--password", type=str) parser.add_argument("-p", "--password", type=str)
parser.add_argument("-d", "--driver", help="Select webdriver. Aside from Firefox, you have to install first the proper driver.", \ parser.add_argument(
type=str, choices=['firefox', 'chrome', 'ie', 'opera', 'safari'], default="firefox") "-d", "--driver",
parser.add_argument("-o", "--old", help="Use old interface", action="store_true") help="Select webdriver. Aside from Firefox, you have to install "
args = parser.parse_args(); + "first the proper driver.", type=str,
choices=['firefox', 'chrome', 'ie', 'opera'],
default="firefox")
args = parser.parse_args()
return args return args
class Browser: class Browser:
## """
# Browser inicializálás Browser initialisation
# @param args Az args.driver paraméterrel meghatározhatjuk, melyik böngészőt akarjuk használni.
# Keyword arguments:
@param args -- args.driver tells us which installed browser
we want to use with selenium.
"""
def __init__(self, args): def __init__(self, args):
self.args = args self.args = args
if args.driver == "firefox": if args.driver == "firefox":
...@@ -54,14 +73,12 @@ class Browser: ...@@ -54,14 +73,12 @@ class Browser:
self.driver = webdriver.Ie() self.driver = webdriver.Ie()
elif args.driver == "opera": elif args.driver == "opera":
self.driver = webdriver.Opera() self.driver = webdriver.Opera()
elif args.driver == "safari":
self.driver = webdriver.Safari()
self.driver.implicitly_wait(10) self.driver.implicitly_wait(10)
##
# Címtáras beléptetés a parancssorban megadott paraméterek alapján
#
def login(self): def login(self):
"""
Eduid login based on the given console arguments
"""
driver = self.driver driver = self.driver
args = self.args args = self.args
if args.username is not None: if args.username is not None:
...@@ -71,51 +88,36 @@ class Browser: ...@@ -71,51 +88,36 @@ class Browser:
driver.find_element_by_name("j_password").clear() driver.find_element_by_name("j_password").clear()
driver.find_element_by_name("j_password").send_keys(args.password) driver.find_element_by_name("j_password").send_keys(args.password)
if args.username is not None and args.password is not None: if args.username is not None and args.password is not None:
driver.find_element_by_css_selector("input[type='submit']").click() driver.find_element_by_css_selector(
"input[type='submit']").click()
##
# A régi webes felület használata
# @return vm Virtuális gép csatlakozásához szükséges paraméterek
#
def old_main(self):
vm = Struct()
driver = self.driver
driver.maximize_window()
driver.get("https://cloud.ik.bme.hu/info/")
driver.find_element_by_css_selector("a[href*='/login/']").click()
self.login()
vm.state, vm.protocol = "", "NONE"
try:
while vm.state.upper()[:3] not in ("FUT", "RUN"):
element = WebDriverWait(driver, 7200).until(EC.presence_of_element_located((By.CSS_SELECTOR, "input.hidden-password.shown[type='text']")))
vm.password = element.get_attribute("value")
vm.state = driver.find_element_by_css_selector("#state > div > p").text
vm.protocol = driver.find_element_by_css_selector("#vm-credentials > div > table > tbody > tr:nth-child(1) > td").text
vm.host,vm.port = driver.find_element_by_css_selector("#vm-credentials > div > table > tbody > tr:nth-child(2) > td").text.split(':')
vm.user = driver.find_element_by_css_selector("#vm-credentials > div > table > tbody > tr:nth-child(4) > td").text
driver.find_element_by_css_selector("a[href*='/logout/']").click()
except:
print "Browser session timed out!"
return vm
##
# Az új webes felület használata
# @return vm Virtuális gép csatlakozásához szükséges paraméterek
#
def main(self): def main(self):
"""
Use of the https://cloud.bme.hu/
Keyword arguments:
@return vm -- Necessarily parameters to connect
to the Virtual Machine
"""
vm = Struct() vm = Struct()
driver = self.driver driver = self.driver
driver.maximize_window() driver.maximize_window()
driver.get("https://pc3.szgt.uni-miskolc.hu/") driver.get("https://cloud.bme.hu/")
#driver.find_element_by_css_selector("a[href*='/login/']").click() # driver.find_element_by_css_selector("a[href*='/login/']").click()
#self.login() # self.login()
vm.state, vm.protocol = "", "NONE" vm.state, vm.protocol = "", "NONE"
try: try:
while vm.state.upper()[:3] not in ("FUT", "RUN"): while vm.state.upper()[:3] not in ("FUT", "RUN"):
element = WebDriverWait(driver,7200).until(EC.presence_of_element_located((By.CSS_SELECTOR, "#vm-details-pw-eye.icon-eye-close"))) WebDriverWait(driver, 7200).until(
vm.state = driver.find_element_by_css_selector("#vm-details-state > span").text EC.presence_of_element_located((
#cl: connection string converted to list By.CSS_SELECTOR,
cl = driver.find_element_by_css_selector("#vm-details-connection-string").get_attribute("value").split() "#vm-details-pw-eye.fa.fa-eye-slash")))
vm.state = driver.find_element_by_css_selector(
"#vm-details-state > span").text
# cl: connection string converted to list
cl = driver.find_element_by_css_selector(
"#vm-details-connection-string").get_attribute(
"value").split()
if cl[0] == "sshpass": if cl[0] == "sshpass":
vm.protocol = "SSH" vm.protocol = "SSH"
vm.user, vm.host = cl[6].split("@") vm.user, vm.host = cl[6].split("@")
...@@ -127,36 +129,35 @@ class Browser: ...@@ -127,36 +129,35 @@ class Browser:
driver.find_element_by_css_selector("a[href*='/logout/']").click() driver.find_element_by_css_selector("a[href*='/logout/']").click()
except: except:
print "Browser session timed out!" print "Browser session timed out!"
raise
return vm return vm
##
# Főprogram
# beolvassuk a paramétereket
# megnyitjuk a kiválasztott böngészőben a weboldalt
# bejelentkezünk a címtárba
# kiválasztjuk a futtatni kívánt klienst
# kapcsolódunk a klienshez
def main(): def main():
args = pars_arguments() """
if args.uri is not None: Main program
vm = Struct() """
vm.protocol, vm.user, vm.password, vm.host, vm.port = args.uri.split(':',4) try:
vm.protocol = vm.protocol.upper() args = parse_arguments()
vm.state = "RUN" if args.uri is not None:
else: vm = Struct()
browser = Browser(args) x, vm.protocol, vm.user, vm.password, vm.host, vm.port = \
if args.old: args.uri.split(':', 5)
vm = browser.old_main() vm.protocol = vm.protocol.upper()
vm.state = "RUN"
else: else:
browser = Browser(args)
vm = browser.main() vm = browser.main()
browser.driver.quit() browser.driver.quit()
if platform.system() == "Linux": if platform.system() == "Linux":
from cloud_connect_from_linux import connect from cloud_connect_from_linux import connect
elif platform.system() == "Windows": elif platform.system() == "Windows":
from cloud_connect_from_windows import connect from cloud_connect_from_windows import connect
if vm.state.upper()[:3] in ("FUT", "RUN"): if vm.state.upper()[:3] in ("FUT", "RUN"):
connect(vm) connect(vm)
except:
print "Unknown error occurred! Please contact the developers!"
if __name__ == "__main__": if __name__ == "__main__":
main() main()
#!/usr/bin/python #!/usr/bin/env python
# -*- coding: utf-8 -*-
import cloud import cloud
...@@ -7,4 +8,3 @@ if __name__ == '__main__': ...@@ -7,4 +8,3 @@ if __name__ == '__main__':
cloud.main() cloud.main()
finally: finally:
pass pass
#!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
## """
# Távoli klienshez csatlakozás linux OS alól Configuration of the Linux specific tools to enhance the ease of use
## of the CIRCLE cloud. Handles the auto launch and auto configuration
of these specific connectivity programs.
"""
import time
import os
import subprocess
import glob
import sys, os, time, subprocess, glob
##
# A távoli klienshez csatlakozás valósítja meg
# NX és RDP esetén a remmina programot hívja meg. Ha a remmina-ban még nem szerepel
# a kliens, a program elkészíti az indításhoz szükséges profilt.
# @param vm Paraméterek a csatlakozáshoz
# vm.protocol SSH, NX és RDP lehetséges
# vm.host A virtuális gép címe
# vm.port Ezen a porton csatlakozunk a virtuális géphez
# vm.user Csatlakozáshoz használt név
# vm.password Csatlakozáshoz használt jelszó
#
def connect(vm): def connect(vm):
"""
Handles to connection to the Virtual Machines from the local
machine
Keyword arguments:
vm.protocol -- SSH, NX and RDP possible
vm.host -- Address of the Virtual Computer
vm.port -- The port where we can access the Virtual Computer
vm.user -- Username used for the connection
vm.password -- Password used for the connection
"""
if vm.protocol == "SSH": 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 -o StrictHostKeyChecking=no %s@%s" % (vm.password, vm.port, vm.user, vm.host)
subprocess.call(command, shell=True) subprocess.call(command, shell=True)
...@@ -42,18 +49,12 @@ def connect(vm): ...@@ -42,18 +49,12 @@ def connect(vm):
f.close() f.close()
subprocess.call(["remmina", "-c", config_file]) subprocess.call(["remmina", "-c", config_file])
NX_template = """[remmina] NX_template = """[remmina]
ssh_auth=0 ssh_auth=0
quality=2 quality=2
disableencryption=0 disableencryption=0
ssh_charset=
ssh_privatekey=
resolution=
group=
ssh_loopback=0 ssh_loopback=0
exec=
ssh_username=
ssh_server=
ssh_enabled=0 ssh_enabled=0
nx_privatekey= nx_privatekey=
showcursor=0 showcursor=0
...@@ -65,24 +66,12 @@ viewmode=4 ...@@ -65,24 +66,12 @@ viewmode=4
RDP_template = """[remmina] RDP_template = """[remmina]
disableclipboard=0 disableclipboard=0
ssh_auth=0 ssh_auth=0
clientname=
quality=2 quality=2
ssh_charset=
ssh_privatekey=
console=0 console=0
resolution=
group=
ssh_loopback=0 ssh_loopback=0
shareprinter=0 shareprinter=0
ssh_username=
ssh_server=
security=
execpath=
sound=off sound=off
exec=
ssh_enabled=0 ssh_enabled=0
sharefolder=
domain=
colordepth=24 colordepth=24
window_maximize=1 window_maximize=1
viewmode=4 viewmode=4
......
# -*- coding: utf-8 -*-
##
# Távoli klienshez csatlakozás windows OS alól
##
##
# A távoli klienshez csatlakozás valósítja majd meg windows alól
# @param vm Paraméterek a csatlakozáshoz
# vm.protocol SSH, NX és RDP lehetséges
# vm.host A virtuális gép címe
# vm.port Ezen a porton csatlakozunk a virtuális géphez
# vm.user Csatlakozáshoz használt név
# vm.password Csatlakozáshoz használt jelszó
#
def connect(vm):
pass
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment