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') ] 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]

View File

@ -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