mirror of https://github.com/Aidaho12/haproxy-wi
commit
70ce151dc1
|
@ -373,7 +373,7 @@ def check_haproxy_config(serv):
|
||||||
commands = [ "haproxy -q -c -f %s" % sql.get_setting('haproxy_config_path') ]
|
commands = [ "haproxy -q -c -f %s" % sql.get_setting('haproxy_config_path') ]
|
||||||
ssh = ssh_connect(serv)
|
ssh = ssh_connect(serv)
|
||||||
for command in commands:
|
for command in commands:
|
||||||
stdin , stdout, stderr = ssh.exec_command(command)
|
stdin , stdout, stderr = ssh.exec_command(command, get_pty=True)
|
||||||
if not stderr.read():
|
if not stderr.read():
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
@ -407,7 +407,7 @@ def ssh_command(serv, commands, **kwargs):
|
||||||
|
|
||||||
for command in commands:
|
for command in commands:
|
||||||
try:
|
try:
|
||||||
stdin, stdout, stderr = ssh.exec_command(command)
|
stdin, stdout, stderr = ssh.exec_command(command,get_pty=True)
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@ -485,4 +485,4 @@ def get_files(dir = get_config_var('configs', 'haproxy_save_configs_dir'), forma
|
||||||
return files
|
return files
|
||||||
|
|
||||||
def get_key(item):
|
def get_key(item):
|
||||||
return item[0]
|
return item[0]
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python3.5
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-"
|
# -*- coding: utf-8 -*-"
|
||||||
import html
|
import html
|
||||||
import cgi
|
import cgi
|
||||||
|
|
Loading…
Reference in New Issue