From a879871cf61a7a17fcaa0bfa0dd3e7efb65da1a5 Mon Sep 17 00:00:00 2001 From: Can KAYA Date: Fri, 28 Sep 2018 15:04:16 +0300 Subject: [PATCH 1/2] get_pty for paramiko fix when u use cloud machines with the restricted permission while working on system files. --- app/funct.py | 4 ++-- app/options.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/funct.py b/app/funct.py index bf073640..30d26c5e 100644 --- a/app/funct.py +++ b/app/funct.py @@ -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(comman, 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 diff --git a/app/options.py b/app/options.py index f757cdde..45fd86bd 100644 --- a/app/options.py +++ b/app/options.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.5 +#!/usr/bin/env python3 # -*- coding: utf-8 -*-" import html import cgi From a4bbe0b197d8304946a127809b9daf4e35d65077 Mon Sep 17 00:00:00 2001 From: Can KAYA Date: Sun, 30 Sep 2018 22:05:02 +0300 Subject: [PATCH 2/2] wrong variable comman instead of command. fixed. --- app/funct.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/funct.py b/app/funct.py index 30d26c5e..b30d7bf7 100644 --- a/app/funct.py +++ b/app/funct.py @@ -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(comman, get_pty=True) + stdin , stdout, stderr = ssh.exec_command(command, get_pty=True) if not stderr.read(): return True else: @@ -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] \ No newline at end of file + return item[0]