mirror of https://github.com/Aidaho12/haproxy-wi
parent
4600980368
commit
aefed2d987
|
@ -251,7 +251,7 @@ def ssh_connect(serv, **kwargs):
|
||||||
ssh.connect(hostname=serv, port=ssh_port, username=ssh_user_name, password=ssh_user_password, timeout=11)
|
ssh.connect(hostname=serv, port=ssh_port, username=ssh_user_name, password=ssh_user_password, timeout=11)
|
||||||
return ssh
|
return ssh
|
||||||
except paramiko.AuthenticationException:
|
except paramiko.AuthenticationException:
|
||||||
return 'error: Authentication failed, please verify your credentials'
|
return 'Authentication failed, please verify your credentials'
|
||||||
pass
|
pass
|
||||||
except paramiko.SSHException as sshException:
|
except paramiko.SSHException as sshException:
|
||||||
return 'error: Unable to establish SSH connection: %s ' % sshException
|
return 'error: Unable to establish SSH connection: %s ' % sshException
|
||||||
|
|
|
@ -1846,7 +1846,13 @@ if form.getvalue('ssh_cert'):
|
||||||
key = paramiko.pkey.load_private_key(form.getvalue('ssh_cert'))
|
key = paramiko.pkey.load_private_key(form.getvalue('ssh_cert'))
|
||||||
ssh_keys = os.path.dirname(os.getcwd()) + '/keys/' + name + '.pem'
|
ssh_keys = os.path.dirname(os.getcwd()) + '/keys/' + name + '.pem'
|
||||||
|
|
||||||
if not os.path.isfile(ssh_keys):
|
try:
|
||||||
|
split_name = name.split('_')[1]
|
||||||
|
split_name = True
|
||||||
|
except Exception:
|
||||||
|
split_name = False
|
||||||
|
|
||||||
|
if not os.path.isfile(ssh_keys) and not split_name:
|
||||||
name = name + '_' + user_group
|
name = name + '_' + user_group
|
||||||
|
|
||||||
if not os.path.exists(os.getcwd() + '/keys/'):
|
if not os.path.exists(os.getcwd() + '/keys/'):
|
||||||
|
|
16
app/sql.py
16
app/sql.py
|
@ -1772,13 +1772,15 @@ def update_setting(param, val):
|
||||||
try:
|
try:
|
||||||
cur.execute(sql)
|
cur.execute(sql)
|
||||||
con.commit()
|
con.commit()
|
||||||
|
cur.close()
|
||||||
|
con.close()
|
||||||
return True
|
return True
|
||||||
except sqltool.Error as e:
|
except sqltool.Error as e:
|
||||||
funct.out_error(e)
|
funct.out_error(e)
|
||||||
con.rollback()
|
con.rollback()
|
||||||
|
cur.close()
|
||||||
|
con.close()
|
||||||
return False
|
return False
|
||||||
cur.close()
|
|
||||||
con.close()
|
|
||||||
|
|
||||||
|
|
||||||
def get_ver():
|
def get_ver():
|
||||||
|
@ -2257,10 +2259,12 @@ def is_cloud():
|
||||||
con.close()
|
con.close()
|
||||||
return ""
|
return ""
|
||||||
else:
|
else:
|
||||||
cur.close()
|
for cl_uuid in cur.fetchall():
|
||||||
con.close()
|
cloud_uuid = cl_uuid[0]
|
||||||
for cloud_uuid in cur.fetchall():
|
|
||||||
return cloud_uuid[0]
|
cur.close()
|
||||||
|
con.close()
|
||||||
|
return cloud_uuid
|
||||||
|
|
||||||
|
|
||||||
form = funct.form
|
form = funct.form
|
||||||
|
|
Loading…
Reference in New Issue