ssh keepalive

loial jldunn2000 at googlemail.com
Thu Oct 2 10:26:25 CEST 2008


<<Show us a bit of your code, so we can see why is None there.>>

    def command ( self , command ) :
        """ process requested command through ssh """
        print command
        if not self._connected :
            return False , "No SSH connection available"
        try :
            stdin , stdout , stderr =
self._ssh.exec_command( command )
            remoteStdOutContent = stdout.readlines()
            remoteStdErrContent = stderr.readlines()
            if remoteStdErrContent != [] :
                return False , '\n'.join(remoteStdErrContent)
            return True , '\n'.join(remoteStdOutContent)
        except paramiko.SSHException , e :
            # provide socket error reason back
            return False , str(e)



More information about the Python-list mailing list