summaryrefslogtreecommitdiffstats
path: root/libs/connect
diff options
context:
space:
mode:
authorVijaykumar <vkoppad@redhat.com>2012-02-13 14:54:42 +0530
committerroot <vkoppad@redhat.com>2012-03-14 21:03:51 +0530
commitda93b886f28f3818cb11a5a35fae37abe2ebb988 (patch)
treee627ca2e4c6cc786f8f52fe42e1a1a08ad6d07bb /libs/connect
parent4a0b5f9d0e0266c8c67b5faa76599fc78a247437 (diff)
Geo-replication library and gluster installation.HEADmaster
* 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 <vkoppad@redhat.com> Signed-off-by: root <root@vostro.(none)>
Diffstat (limited to 'libs/connect')
-rwxr-xr-xlibs/connect/ssh.py27
1 files changed, 4 insertions, 23 deletions
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()