aboutsummaryrefslogtreecommitdiff
path: root/rumba/prototypes/enroll.py
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2017-09-14 17:31:57 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2017-09-15 13:34:19 +0200
commite2a1fb51201f22b2315843b684665245ee35e171 (patch)
treeeb7db46058018b1a771bf9839372c098b7daebce /rumba/prototypes/enroll.py
parente93a3a734362034b45b775cbd968abc8ee994e74 (diff)
downloadrumba-e2a1fb51201f22b2315843b684665245ee35e171.tar.gz
rumba-e2a1fb51201f22b2315843b684665245ee35e171.zip
rumba: Add better error handling of SSH connect
If an SSH connect doesn't succeed at first, it is retried up to 5 times with an exponential backoff. It also adds an error message in case of an offending host key.
Diffstat (limited to 'rumba/prototypes/enroll.py')
-rwxr-xr-xrumba/prototypes/enroll.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/rumba/prototypes/enroll.py b/rumba/prototypes/enroll.py
index 774ba52..35cc136 100755
--- a/rumba/prototypes/enroll.py
+++ b/rumba/prototypes/enroll.py
@@ -28,6 +28,7 @@ import argparse
import socket
import time
import re
+import sys
def printalo(byt):
print(repr(byt).replace('\\n', '\n'))
@@ -133,5 +134,6 @@ if connected:
else:
print('Failed to connect to "%s"' % socket_name)
+ sys.exit(-1)
s.close()