From 9014b2388eac2f48ccd50d8b1e1481fbc72b152e Mon Sep 17 00:00:00 2001 From: Scott Daniels Date: Thu, 5 Sep 2013 10:53:15 -0400 Subject: [PATCH] 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 --- inception/utils/cmd.py | 1 + 1 file changed, 1 insertion(+) 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): port = 22 ## construct flags flags = ['-T'] + flags.append('-n') # prevent read blocking on tty (stdin) if silent: flags.append('-o StrictHostKeyChecking=no') flags.append('-o UserKnownHostsFile=/dev/null')