summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Daniels <daniels@research.att.com>2013-09-05 10:53:15 -0400
committerScott Daniels <daniels@research.att.com>2013-09-05 11:21:06 -0400
commit9014b2388eac2f48ccd50d8b1e1481fbc72b152e (patch)
tree712eb5b5bdbf67841b17f6a1823f250025d44d70
parenta5c4ac10f7a99ed6192cdf93f9eaec3d820b10b6 (diff)
Force tty (stdin) closed on ssh commands.
Adding the -n to the ssh command forces ssh to redirect stdin from /dev/null and prevents the remote processes from blocking waiting for user (tty) input. Change-Id: Ic659c951926e81eacb0db72c6ff0668b5bd38167
Notes
Notes (review): Verified+2: Jenkins Approved+1: Changbin Liu <changbin.liu@gmail.com> Code-Review+2: Changbin Liu <changbin.liu@gmail.com> Submitted-by: Jenkins Submitted-at: Thu, 05 Sep 2013 17:06:02 +0000 Reviewed-on: https://review.openstack.org/45241 Project: stackforge/inception Branch: refs/heads/master
-rw-r--r--inception/utils/cmd.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/inception/utils/cmd.py b/inception/utils/cmd.py
index 4f7c691..5e73e1d 100644
--- a/inception/utils/cmd.py
+++ b/inception/utils/cmd.py
@@ -77,6 +77,7 @@ def ssh(uri, cmd, screen_output=False, silent=True, agent_forwarding=False):
77 port = 22 77 port = 22
78 ## construct flags 78 ## construct flags
79 flags = ['-T'] 79 flags = ['-T']
80 flags.append('-n') # prevent read blocking on tty (stdin)
80 if silent: 81 if silent:
81 flags.append('-o StrictHostKeyChecking=no') 82 flags.append('-o StrictHostKeyChecking=no')
82 flags.append('-o UserKnownHostsFile=/dev/null') 83 flags.append('-o UserKnownHostsFile=/dev/null')