From 4a96b4e62d9e08cd3edb228b1294c686f9e30a0d Mon Sep 17 00:00:00 2001 From: Yaron Yogev Date: Wed, 2 Aug 2017 14:02:18 +0300 Subject: Fix sending of restart command to Sensu server: - SshConnection: get_ssh(): handle host == monitoring server - if host is the one defined in Monitoring config, use the access definitions for the server_ip - Fix connections management: - no need to disinguish between CLI connections and SFTP ones; - add get_connection_key(); - rename the Paramiko SSH client data member --> ssh_client Change-Id: I73406caf6f617068d907f6d771bccf4fb3c5e289 Signed-off-by: Yaron Yogev --- app/monitoring/setup/monitoring_handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/monitoring/setup/monitoring_handler.py') diff --git a/app/monitoring/setup/monitoring_handler.py b/app/monitoring/setup/monitoring_handler.py index 5b7cae0..f041264 100644 --- a/app/monitoring/setup/monitoring_handler.py +++ b/app/monitoring/setup/monitoring_handler.py @@ -211,8 +211,8 @@ class MonitoringHandler(MongoAccess, CliAccess, BinaryConverter): def get_ssh(self, host, is_container=False, for_sftp=False): ssh = SshConnection.get_ssh(host, for_sftp) if not ssh: - if is_container: - conf = self.env_monitoring_config + conf = self.env_monitoring_config + if is_container or host == conf['server_ip']: host = conf['server_ip'] port = int(conf['ssh_port']) user = conf['ssh_user'] -- cgit 1.2.3-korg