Commit 325bbd98 authored by Antoine Catton's avatar Antoine Catton

Add timeout on ssh rdiff-backup promise.

parent 1505c512
......@@ -30,6 +30,7 @@ from urlparse import urlparse
import os
import subprocess
import sys
import time
from slapos.recipe.librecipe import GenericBaseRecipe
from slapos.recipe.dropbear import KnownHostsFile
......@@ -53,6 +54,10 @@ def promise(args):
ssh.stdin.flush()
ssh.stdin.close()
time.sleep(2)
if ssh.poll() is None:
ssh.kill()
if ssh.wait() != 0:
# Bad python 2 syntax, looking forward python 3 to have print(file=)
print >> sys.stderr, "SSH Connection failed"
......
Markdown is supported
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