Skip to content

Commit fb5ea25

Browse files
author
Prasanna Santhanam
committed
marvin: remoteSSHclient logs
Adding logging for commands sent, and executed with results returned frmo the remote host.
1 parent 6f29317 commit fb5ea25

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎tools/marvin/marvin/remoteSSHClient.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import time
2020
import cloudstackException
2121
import contextlib
22+
import logging
2223
from contextlib import closing
2324

2425
class remoteSSHClient(object):
@@ -34,6 +35,7 @@ def __init__(self, host, port, user, passwd, retries = 10):
3435
while True:
3536
try:
3637
self.ssh.connect(str(host),int(port), user, passwd)
38+
logging.debug("[SSHClient] connecting to server %s @ port % with user:passwd %s:%s"%(str(host), port, user, passwd))
3739
except paramiko.SSHException, sshex:
3840
if retry_count == 0:
3941
raise cloudstackException.InvalidParameterException(repr(sshex))
@@ -46,6 +48,7 @@ def __init__(self, host, port, user, passwd, retries = 10):
4648

4749
def execute(self, command):
4850
stdin, stdout, stderr = self.ssh.exec_command(command)
51+
logging.debug("[SSHClient] sending command %s to host"%(command, str(self.host)))
4952
output = stdout.readlines()
5053
errors = stderr.readlines()
5154
results = []
@@ -57,7 +60,7 @@ def execute(self, command):
5760
else:
5861
for strOut in output:
5962
results.append(strOut.rstrip())
60-
63+
logging.debug("[SSHClient] command %s returned %s"%(command, results))
6164
return results
6265

6366
def scp(self, srcFile, destPath):

0 commit comments

Comments
 (0)