From fb5ea25a4d50f4530fcf535d66d7b38e53612e00 Mon Sep 17 00:00:00 2001 From: Prasanna Santhanam Date: Thu, 13 Dec 2012 15:57:59 -0800 Subject: [PATCH] marvin: remoteSSHclient logs Adding logging for commands sent, and executed with results returned frmo the remote host. --- tools/marvin/marvin/remoteSSHClient.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/marvin/marvin/remoteSSHClient.py b/tools/marvin/marvin/remoteSSHClient.py index 036e1c381e1..24ba0fe185f 100644 --- a/tools/marvin/marvin/remoteSSHClient.py +++ b/tools/marvin/marvin/remoteSSHClient.py @@ -19,6 +19,7 @@ import paramiko import time import cloudstackException import contextlib +import logging from contextlib import closing class remoteSSHClient(object): @@ -34,6 +35,7 @@ class remoteSSHClient(object): while True: try: self.ssh.connect(str(host),int(port), user, passwd) + logging.debug("[SSHClient] connecting to server %s @ port % with user:passwd %s:%s"%(str(host), port, user, passwd)) except paramiko.SSHException, sshex: if retry_count == 0: raise cloudstackException.InvalidParameterException(repr(sshex)) @@ -46,6 +48,7 @@ class remoteSSHClient(object): def execute(self, command): stdin, stdout, stderr = self.ssh.exec_command(command) + logging.debug("[SSHClient] sending command %s to host"%(command, str(self.host))) output = stdout.readlines() errors = stderr.readlines() results = [] @@ -57,7 +60,7 @@ class remoteSSHClient(object): else: for strOut in output: results.append(strOut.rstrip()) - + logging.debug("[SSHClient] command %s returned %s"%(command, results)) return results def scp(self, srcFile, destPath):