From 953426603faf3d46cb54c9c78db91042bdb8ca98 Mon Sep 17 00:00:00 2001 From: James Wettenhall Date: Thu, 4 May 2017 08:57:46 +1000 Subject: [PATCH] New PyInstaller version requires redirecting all pipes in subprocess. --- mydata/utils/openssh.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mydata/utils/openssh.py b/mydata/utils/openssh.py index 99414d2e..dcd42087 100644 --- a/mydata/utils/openssh.py +++ b/mydata/utils/openssh.py @@ -218,6 +218,7 @@ def ReadFingerprintAndKeyType(self): cmdList = [OPENSSH.sshKeyGen, "-yl", "-f", self.privateKeyFilePath] logger.debug(" ".join(cmdList)) proc = subprocess.Popen(cmdList, + stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, startupinfo=DEFAULT_STARTUP_INFO, @@ -299,6 +300,7 @@ def NewKeyPair(keyName=None, keyPath=None, keyComment=None): cmd = " ".join(cmdList) logger.debug(cmd) proc = subprocess.Popen(cmd, + stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True, @@ -344,6 +346,7 @@ def SshServerIsReady(username, privateKeyFilePath, logger.debug(cmdString) proc = subprocess.Popen(cmdString, shell=OPENSSH.preferToUseShellInSubprocess, + stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, startupinfo=DEFAULT_STARTUP_INFO, @@ -468,6 +471,7 @@ def UploadFileFromPosixSystem(filePath, fileSize, username, privateKeyFilePath, mkdirProcess = \ subprocess.Popen(mkdirCmdString, shell=OPENSSH.preferToUseShellInSubprocess, + stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, startupinfo=DEFAULT_STARTUP_INFO, @@ -510,6 +514,7 @@ def UploadFileFromPosixSystem(filePath, fileSize, username, privateKeyFilePath, scpUploadProcess = subprocess.Popen( scpCommandString, shell=OPENSSH.preferToUseShellInSubprocess, + stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, startupinfo=DEFAULT_STARTUP_INFO, @@ -590,6 +595,7 @@ def UploadFileFromWindows(filePath, fileSize, username, mkdirProcess = \ subprocess.Popen(mkdirCmdString, shell=OPENSSH.preferToUseShellInSubprocess, + stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, startupinfo=DEFAULT_STARTUP_INFO, @@ -624,6 +630,7 @@ def UploadFileFromWindows(filePath, fileSize, username, logger.debug(scpCommandString) scpUploadProcess = subprocess.Popen( scpCommandString, + stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, startupinfo=DEFAULT_STARTUP_INFO,