diff options
author | Yaron Yogev <yaronyogev@gmail.com> | 2017-08-02 14:02:18 +0300 |
---|---|---|
committer | Yaron Yogev <yaronyogev@gmail.com> | 2017-08-02 15:09:20 +0300 |
commit | ffdf764c73ea8d7e5dab94a073ac7b0f079fc19a (patch) | |
tree | 25388ff23a65b63fecafd574a6db58eb9365463f /app/monitoring/setup | |
parent | 56f1739be70fd771b6e464024a09f7b0be4bbf5f (diff) |
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: I9e127774c9287d81d73ce5ba02704d3b7cda6725
Signed-off-by: Yaron Yogev <yaronyogev@gmail.com>
Diffstat (limited to 'app/monitoring/setup')
-rw-r--r-- | app/monitoring/setup/monitoring_handler.py | 4 |
1 files changed, 2 insertions, 2 deletions
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'] |