mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 18:00:35 +00:00
Always attempt to close SSH gracefully
This commit is contained in:
parent
e9a3845281
commit
a0e3ba218f
1 changed files with 10 additions and 6 deletions
|
@ -63,13 +63,17 @@ class RemoteBuildServer(BuildServer):
|
|||
'local_callback_port': local_callback_port,
|
||||
'remote_server_port': remote_server_port,
|
||||
'remote_callback_port': remote_callback_port}
|
||||
except (Exception, KeyboardInterrupt):
|
||||
log.debug('Forcefully terminating SSH connection to the build server')
|
||||
ssh_process.terminate()
|
||||
raise
|
||||
else:
|
||||
finally:
|
||||
log.debug('Waiting for SSH connection to the build server to close')
|
||||
ssh_process.wait()
|
||||
import time
|
||||
start = time.time()
|
||||
while ssh_process.poll() is None:
|
||||
if time.time() - start > 5:
|
||||
log.debug('Forcefully terminating SSH connection to the build server')
|
||||
ssh_process.terminate()
|
||||
break
|
||||
else:
|
||||
time.sleep(0.5)
|
||||
|
||||
def download(self, src, dst):
|
||||
log.debug('Downloading file `{src}\' from '
|
||||
|
|
Loading…
Add table
Reference in a new issue