Merge pull request #50 from cankaya07/master

get_pty for paramiko
pull/56/head
Pavel Loginov 2018-10-01 08:28:13 +06:00 committed by GitHub
commit 70ce151dc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -373,7 +373,7 @@ def check_haproxy_config(serv):
commands = [ "haproxy -q -c -f %s" % sql.get_setting('haproxy_config_path') ]
ssh = ssh_connect(serv)
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():
return True
else:
@ -407,7 +407,7 @@ def ssh_command(serv, commands, **kwargs):
for command in commands:
try:
stdin, stdout, stderr = ssh.exec_command(command)
stdin, stdout, stderr = ssh.exec_command(command,get_pty=True)
except:
continue
@ -485,4 +485,4 @@ def get_files(dir = get_config_var('configs', 'haproxy_save_configs_dir'), forma
return files
def get_key(item):
return item[0]
return item[0]

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python3.5
#!/usr/bin/env python3
# -*- coding: utf-8 -*-"
import html
import cgi