remotelogin/connections/ssh/__init__.py
def _get_ftp_client(self, window_size=None, max_packet_size=None, buffer_size=None):
        """ opens an sftp or scp channel and closes it after execution finished

        Returns:

        """
        window_size = window_size or settings.SFTP_SCP_WINDOW_SIZE
        max_packet_size = max_packet_size or settings.SFTP_SCP_MAX_PACKET_SIZE
        buffer_size = buffer_size or settings.SFTP_SCP_BUFFER_SIZE

        c = None

        try:
            if self.file_transfer_protocol == 'sftp':
                c = SFTPClient.from_transport(self.ssh_transport,
                                              window_size=window_size,
                                              max_packet_size=max_packet_size)
            else:
                c = scp.SCPClient(self.ssh_transport, buff_size=buffer_size)

            yield c
        finally:
            try:
                if c:
                    c.close()
            except Exception:
                log.exception('problems closing sftp/scp client')
 opens an sftp or scp channel and closes it after execution finished

        Returns:

        
opens an sftp or scp channel and closes it after execution finished
opens an sftp or scp channel and closes it after execution finished
def _get_ftp_client(self, window_size=None, max_packet_size=None, buffer_size=None):
        window_size = window_size or settings.SFTP_SCP_WINDOW_SIZE
        max_packet_size = max_packet_size or settings.SFTP_SCP_MAX_PACKET_SIZE
        buffer_size = buffer_size or settings.SFTP_SCP_BUFFER_SIZE
        c = None
        try:
            if self.file_transfer_protocol == 'sftp':
                c = SFTPClient.from_transport(self.ssh_transport,
                                              window_size=window_size,
                                              max_packet_size=max_packet_size)
            else:
                c = scp.SCPClient(self.ssh_transport, buff_size=buffer_size)
            yield c
        finally:
            try:
                if c:
                    c.close()
            except Exception:
                log.exception('problems closing sftp/scp client')
def _get_ftp_client ( self , window_size = None , max_packet_size = None , buffer_size = None ) : window_size = window_size or settings . SFTP_SCP_WINDOW_SIZE max_packet_size = max_packet_size or settings . SFTP_SCP_MAX_PACKET_SIZE buffer_size = buffer_size or settings . SFTP_SCP_BUFFER_SIZE c = None try : if self . file_transfer_protocol == 'sftp' : c = SFTPClient . from_transport ( self . ssh_transport , window_size = window_size , max_packet_size = max_packet_size ) else : c = scp . SCPClient ( self . ssh_transport , buff_size = buffer_size ) yield c finally : try : if c : c . close ( ) except Exception : log . exception ( 'problems closing sftp/scp client' )
opens an sftp or scp channel and closes it after execution finished
opens an sftp or scp channel and closes it after execution finished
""" opens an sftp or scp channel and closes it after execution finished

        Returns:

        """
None
self
window_size
max_packet_size
buffer_size