FAQ | This is a LIVE service | Changelog

Commit cb7d63c3 authored by Jon Marshall's avatar Jon Marshall
Browse files

Re-ordered netcat error readout, as otherwise it was getting swallowed by the...

Re-ordered netcat error readout, as otherwise it was getting swallowed by the raised connectionerror from _gtet_connection
parent 9674bb61
......@@ -355,6 +355,19 @@ class RemoteDataset(Dataset):
# Quick sleep to allow nc to get ready
time.sleep(3)
self.log.debug('Establishing connection to remote port %i', port)
try:
nc_output = nc_out.read()
if nc_output:
self.log.error('Netcat output: %s', nc_error)
except socket.timeout:
self.log.debug('No netcat output to read')
try:
nc_error = nc_err.read()
if nc_error:
self.log.error('Netcat error: %s', nc_error)
#raise ConnectionError
except socket.timeout:
self.log.debug('No netcat error to read')
conduit = self._get_connection(port)
while not nc_err.channel.exit_status_ready():
data = sendproc.stdout.read(4096)
......@@ -369,19 +382,6 @@ class RemoteDataset(Dataset):
raise
else:
break
try:
nc_output = nc_out.read()
if nc_output:
self.log.error('Netcat error: %s', nc_error)
except socket.timeout:
self.log.debug('No netcat output to read')
try:
nc_error = nc_err.read()
if nc_error:
self.log.error('Netcat error: %s', nc_error)
#raise ConnectionError
except socket.timeout:
self.log.debug('No netcat error to read')
self.log.info('Send successful')
conduit.close()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment