From da93b886f28f3818cb11a5a35fae37abe2ebb988 Mon Sep 17 00:00:00 2001 From: Vijaykumar Date: Mon, 13 Feb 2012 14:54:42 +0530 Subject: Geo-replication library and gluster installation. * Geo-replication library function in glusterutils * A new section in configuration file for geo-rep * In gluster installation , changing libexecdir to /usr/local/libexec in configuration. * Removed some unwanted code. * handling to have a geo-rep session locally also. Change-Id: Ifcf00b73ed933077640113ce0528b39bdad55999 Signed-off-by: Vijaykumar Signed-off-by: root --- libs/connect/ssh.py | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) (limited to 'libs/connect/ssh.py') diff --git a/libs/connect/ssh.py b/libs/connect/ssh.py index e4540d5..c2d5613 100755 --- a/libs/connect/ssh.py +++ b/libs/connect/ssh.py @@ -78,32 +78,13 @@ class SshConnection(): transport = self._connection.get_transport() channel = transport.open_session() channel.exec_command(command) - # Adding sleep to get the correct exit_status. - timeout = 60 - sleeptime = 5 - while timeout: - time.sleep(sleeptime) - exit_status_ready_flag = channel.exit_status_ready() - if not exit_status_ready_flag: - timeout -=1 - continue - else: - break - - if not exit_status_ready_flag: - stdin = channel.makefile("wb") - - if commandInput: - stdin.write(commandInput) - else: - logger.error("This command requirs Command Input \ - after executing comamnd for command completion") - stdin.write("\n") - return output + stdin = channel.makefile("wb") + if commandInput: + stdin.write(commandInput) + exit_status = channel.recv_exit_status() stdout = channel.makefile("rb") stderr = channel.makefile_stderr("rb") - exit_status = channel.recv_exit_status() output["exitstatus"] = exit_status output["stdoutdata"] = stdout.readlines() -- cgit