Commit df2cfe8b by Csók Tamás

client: flake8 correction

parent b2bf7691
......@@ -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\nprotocol=%s\nserver=%s\nusername=%s\npassword=%s\n" % (vm.protocol, server, vm.protocol, server, vm.user, password))
f.write("name=%s:%s\n" % (vm.protocol, server)
+ "protocol=%s\nserver=%s\n" % (vm.protocol, server)
+ "username=%s\npassword=%s\n" % (vm.user, password))
f.close()
subprocess.call(["remmina", "-c", config_file])
......
......@@ -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\nprotocol=%s\nserver=%s\nusername=%s\npassword=%s\n" % (vm.protocol, server, vm.protocol, server, vm.user, password))
f.write("name=%s:%s\n" % (vm.protocol, server)
+ "protocol=%s\nserver=%s\n" % (vm.protocol, server)
+ "username=%s\npassword=%s\n" % (vm.user, password))
f.close()
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