aboutsummaryrefslogtreecommitdiffstats
path: root/deploy
diff options
context:
space:
mode:
authorPeter Barabas <peter.barabas@ericsson.com>2016-06-26 12:15:25 +0200
committerPeter Barabas <peter.barabas@ericsson.com>2016-06-26 12:15:25 +0200
commit806de12e942711236fc82f860fa100418fcc17ec (patch)
treed8bf6264e2ace894733888bcf8d2492be3ca8a24 /deploy
parentf2656175b7aff1aa7ef5b32e6dfdf1858b612102 (diff)
Add timeout for SCP operations
The default timeout for SCP is 5 seconds, which is not enough in some cases. Change-Id: If44669a96ea4b5ce33441eeea36b8cf66a1cdc4a Signed-off-by: Peter Barabas <peter.barabas@ericsson.com>
Diffstat (limited to 'deploy')
-rw-r--r--deploy/ssh_client.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/deploy/ssh_client.py b/deploy/ssh_client.py
index f6888d52d..24119dbfa 100644
--- a/deploy/ssh_client.py
+++ b/deploy/ssh_client.py
@@ -1,6 +1,7 @@
###############################################################################
# Copyright (c) 2015 Ericsson AB and others.
# szilard.cserey@ericsson.com
+# peter.barabas@ericsson.com
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
@@ -85,14 +86,18 @@ class SSHClient(object):
def scp_get(self, remote, local='.', dir=False):
try:
- with scp.SCPClient(self.client.get_transport(), sanitize=lambda x: x) as _scp:
+ with scp.SCPClient(self.client.get_transport(),
+ sanitize=lambda x: x,
+ socket_timeout=TIMEOUT) as _scp:
_scp.get(remote, local, dir)
except Exception as e:
err(e)
def scp_put(self, local, remote='.', dir=False):
try:
- with scp.SCPClient(self.client.get_transport(), sanitize=lambda x: x) as _scp:
+ with scp.SCPClient(self.client.get_transport(),
+ sanitize=lambda x: x,
+ socket_timeout=TIMEOUT) as _scp:
_scp.put(local, remote, dir)
except Exception as e:
err(e)