Commit 9334dd45 by Csók Tamás

client: changed some strings

parent af39cb57
...@@ -46,9 +46,11 @@ def parse_arguments(): ...@@ -46,9 +46,11 @@ def parse_arguments():
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( parser.add_argument(
"-d", "--driver", "-d",
help="Select webdriver. Aside from Firefox, you have to install " "--driver",
+ "first the proper driver.", type=str, help=("Select webdriver. Aside from Firefox, you have to install "
"first the proper driver."),
type=str,
choices=['firefox', 'chrome', 'ie', 'opera'], choices=['firefox', 'chrome', 'ie', 'opera'],
default="firefox") default="firefox")
args = parser.parse_args() args = parser.parse_args()
......
...@@ -27,7 +27,7 @@ def connect(vm): ...@@ -27,7 +27,7 @@ def connect(vm):
""" """
if vm.protocol == "SSH": if vm.protocol == "SSH":
command = ("sshpass -p %s ssh -p %s" % (vm.password, vm.port) command = ("sshpass -p %s ssh -p %s" % (vm.password, vm.port)
+ " -o StrictHostKeyChecking=no %s@%s" % (vm.user, vm.host)) " -o StrictHostKeyChecking=no %s@%s" % (vm.user, vm.host))
subprocess.call(command, shell=True) subprocess.call(command, shell=True)
elif vm.protocol in ("NX", "RDP"): elif vm.protocol in ("NX", "RDP"):
server = "%s:%s" % (vm.host, vm.port) server = "%s:%s" % (vm.host, vm.port)
...@@ -48,9 +48,14 @@ def connect(vm): ...@@ -48,9 +48,14 @@ def connect(vm):
f.write(NX_template) f.write(NX_template)
else: else:
f.write(RDP_template) f.write(RDP_template)
f.write("name=%s:%s\n" % (vm.protocol, server) f.write("name=%(protocol)s:%(server)s\nprotocol=%(protocol)s\n"
+ "protocol=%s\nserver=%s\n" % (vm.protocol, server) "server=%(server)s\nusername=%(username)s\n"
+ "username=%s\npassword=%s\n" % (vm.user, password)) "password=%(password)s\n" % {
'protocol': vm.protocol,
'server': server,
'username': vm.user,
'password': vm.password
})
f.close() f.close()
subprocess.call(["remmina", "-c", config_file]) subprocess.call(["remmina", "-c", config_file])
......
...@@ -46,9 +46,11 @@ def parse_arguments(): ...@@ -46,9 +46,11 @@ def parse_arguments():
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( parser.add_argument(
"-d", "--driver", "-d",
help="Select webdriver. Aside from Firefox, you have to install " "--driver",
+ "first the proper driver.", type=str, help=("Select webdriver. Aside from Firefox, you have to install "
"first the proper driver."),
type=str,
choices=['firefox', 'chrome', 'ie', 'opera'], choices=['firefox', 'chrome', 'ie', 'opera'],
default="firefox") default="firefox")
args = parser.parse_args() args = parser.parse_args()
......
...@@ -27,7 +27,7 @@ def connect(vm): ...@@ -27,7 +27,7 @@ def connect(vm):
""" """
if vm.protocol == "SSH": if vm.protocol == "SSH":
command = ("sshpass -p %s ssh -p %s" % (vm.password, vm.port) command = ("sshpass -p %s ssh -p %s" % (vm.password, vm.port)
+ " -o StrictHostKeyChecking=no %s@%s" % (vm.user, vm.host)) " -o StrictHostKeyChecking=no %s@%s" % (vm.user, vm.host))
subprocess.call(command, shell=True) subprocess.call(command, shell=True)
elif vm.protocol in ("NX", "RDP"): elif vm.protocol in ("NX", "RDP"):
server = "%s:%s" % (vm.host, vm.port) server = "%s:%s" % (vm.host, vm.port)
...@@ -48,9 +48,14 @@ def connect(vm): ...@@ -48,9 +48,14 @@ def connect(vm):
f.write(NX_template) f.write(NX_template)
else: else:
f.write(RDP_template) f.write(RDP_template)
f.write("name=%s:%s\n" % (vm.protocol, server) f.write("name=%(protocol)s:%(server)s\nprotocol=%(protocol)s\n"
+ "protocol=%s\nserver=%s\n" % (vm.protocol, server) "server=%(server)s\nusername=%(username)s\n"
+ "username=%s\npassword=%s\n" % (vm.user, password)) "password=%(password)s\n" % {
'protocol': vm.protocol,
'server': server,
'username': vm.user,
'password': vm.password
})
f.close() f.close()
subprocess.call(["remmina", "-c", config_file]) subprocess.call(["remmina", "-c", config_file])
......
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