irrad_control/utils/proc_manager.py
def _exec_cmd(self, hostname, cmd, log_stdout=False):
        """Execute command on server using paramikos SSH implementation"""

        # Sanity check
        if hostname not in self.client:
            logging.warning("SSH-client not connected to server. Call {}.connect_to_server method."
                            .format(self.__class__.__name__))
            return
        
        # Execute; this is non-blocking so we have to wait until cmd has been transmitted to server before closing
        stdin, stdout, stderr = self.client[hostname].exec_command(cmd)
        
        # No writing to stdin and stdout happens
        stdin.close()
        stdout.channel.shutdown_write()
        
        if log_stdout:
            while not stdout.channel.exit_status_ready():
                msg = stdout.readline().strip()
                if msg:
                    logging.info(msg)
                
        stdout.close()
        stderr.close()
Execute command on server using paramikos SSH implementation
Execute command on server using paramikos SSH implementation
Execute command on server using paramikos SSH implementation
def _exec_cmd(self, hostname, cmd, log_stdout=False):
        if hostname not in self.client:
            logging.warning("SSH-client not connected to server. Call {}.connect_to_server method."
                            .format(self.__class__.__name__))
            return
        stdin, stdout, stderr = self.client[hostname].exec_command(cmd)
        stdin.close()
        stdout.channel.shutdown_write()
        if log_stdout:
            while not stdout.channel.exit_status_ready():
                msg = stdout.readline().strip()
                if msg:
                    logging.info(msg)
        stdout.close()
        stderr.close()
def _exec_cmd ( self , hostname , cmd , log_stdout = False ) : if hostname not in self . client : logging . warning ( "SSH-client not connected to server. Call {}.connect_to_server method." . format ( self . __class__ . __name__ ) ) return stdin , stdout , stderr = self . client [ hostname ] . exec_command ( cmd ) stdin . close ( ) stdout . channel . shutdown_write ( ) if log_stdout : while not stdout . channel . exit_status_ready ( ) : msg = stdout . readline ( ) . strip ( ) if msg : logging . info ( msg ) stdout . close ( ) stderr . close ( )
Execute command on server using paramikos SSH implementation
Execute command on server using paramikos SSH implementation
"""Execute command on server using paramikos SSH implementation""" # Sanity check # Execute; this is non-blocking so we have to wait until cmd has been transmitted to server before closing # No writing to stdin and stdout happens
self
hostname
cmd
log_stdout