Merge "gerrit: Allow sending data with ssh command"

This commit is contained in:
Jenkins
2015-11-15 14:31:44 +00:00
committed by Gerrit Code Review

View File

@@ -184,7 +184,7 @@ class Gerrit(object):
key_filename=self.keyfile)
self.client = client
def _ssh(self, command):
def _ssh(self, command, stdin_data=None):
if not self.client:
self._open()
@@ -195,6 +195,9 @@ class Gerrit(object):
self._open()
stdin, stdout, stderr = self.client.exec_command(command)
if stdin_data:
stdin.write(stdin_data)
out = stdout.read()
self.log.debug("SSH received stdout:\n%s" % out)