mirror of https://github.com/Aidaho12/haproxy-wi
parent
791802ee02
commit
2e060eb801
|
@ -1386,12 +1386,10 @@ def server_status(stdout):
|
||||||
|
|
||||||
|
|
||||||
def ssh_command(server_ip, commands, **kwargs):
|
def ssh_command(server_ip, commands, **kwargs):
|
||||||
from shlex import quote
|
|
||||||
ssh = ssh_connect(server_ip)
|
ssh = ssh_connect(server_ip)
|
||||||
|
|
||||||
for command in commands:
|
for command in commands:
|
||||||
try:
|
try:
|
||||||
command = quote(command)
|
|
||||||
stdin, stdout, stderr = ssh.exec_command(command, get_pty=True)
|
stdin, stdout, stderr = ssh.exec_command(command, get_pty=True)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging('localhost', ' ' + str(e), haproxywi=1)
|
logging('localhost', ' ' + str(e), haproxywi=1)
|
||||||
|
|
|
@ -291,7 +291,7 @@ $( function() {
|
||||||
if (data.indexOf('error:') != '-1') {
|
if (data.indexOf('error:') != '-1') {
|
||||||
toastr.clear();
|
toastr.clear();
|
||||||
toastr.error(data);
|
toastr.error(data);
|
||||||
} else if(data == 'no' || data == '') {
|
} else if(data == 'no' || data == '' || data.indexOf('No') != '-1') {
|
||||||
$('#cur_haproxy_exp_ver').text('HAProxy exporter has been not installed');
|
$('#cur_haproxy_exp_ver').text('HAProxy exporter has been not installed');
|
||||||
} else {
|
} else {
|
||||||
$('#cur_haproxy_exp_ver').text(data);
|
$('#cur_haproxy_exp_ver').text(data);
|
||||||
|
|
Loading…
Reference in New Issue