Skip to content
Snippets Groups Projects
Commit 63ffb733 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

Task #8725: connect stdin of ssh processes to dev null

parent 17af2fb0
No related branches found
No related tags found
No related merge requests found
......@@ -248,6 +248,7 @@ class LtaCp:
estimated_tar_size = 512*(input_datasize / 512) + 3*512 #512byte header, 2*512byte ending, 512byte modulo data
tar_record_size = 10240 # 20 * 512 byte blocks
with open(os.devnull, 'r') as devnull:
# start sending remote data, tee to fifo
src_path_parent, src_path_child = os.path.split(self.src_path_data)
cmd_remote_data = self.ssh_cmd + ['cd %s && tar c --checkpoint=100 --checkpoint-action="ttyout=checkpoint %%u\\n" -O %s | tee %s | %s %s %s' % (src_path_parent,
......@@ -257,13 +258,13 @@ class LtaCp:
self.localIPAddress,
port_data)]
logger.info('ltacp %s: remote starting transfer. executing: %s' % (self.logId, ' '.join(cmd_remote_data)))
p_remote_data = Popen(cmd_remote_data, stdout=PIPE, stderr=PIPE)
p_remote_data = Popen(cmd_remote_data, stdin=devnull, stdout=PIPE, stderr=PIPE)
self.started_procs[p_remote_data] = cmd_remote_data
# start computation of checksum on remote fifo stream
cmd_remote_checksum = self.ssh_cmd + ['md5sum %s | %s %s %s' % (self.remote_data_fifo, self.remoteNetCatCmd, self.localIPAddress, port_md5)]
logger.info('ltacp %s: remote starting computation of md5 checksum. executing: %s' % (self.logId, ' '.join(cmd_remote_checksum)))
p_remote_checksum = Popen(cmd_remote_checksum, stdout=PIPE, stderr=PIPE)
p_remote_checksum = Popen(cmd_remote_checksum, stdin=devnull, stdout=PIPE, stderr=PIPE)
self.started_procs[p_remote_checksum] = cmd_remote_checksum
# timedelta.total_seconds is only available for python >= 2.7
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment