From a3373fb60aac7f3fee9ec28afebc0e55d28d5438 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Mon, 22 Aug 2011 23:21:35 -0400 Subject: util.subp: do not attach stdin cloud-init's stdin to subprocesses (LP: 831505) Fix issue where 'isatty' would return true for apt-add-repository. It would get stdin which was attached to a terminal (/dev/console) and would thus hang when running during boot. This was done by changing all users of util.subp to have None input unless input was given. In that case, the input will be the string passed in. LP: #831505 --- cloudinit/CloudConfig/cc_apt_update_upgrade.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cloudinit/CloudConfig') diff --git a/cloudinit/CloudConfig/cc_apt_update_upgrade.py b/cloudinit/CloudConfig/cc_apt_update_upgrade.py index 41c34bc3..495b8522 100644 --- a/cloudinit/CloudConfig/cc_apt_update_upgrade.py +++ b/cloudinit/CloudConfig/cc_apt_update_upgrade.py @@ -127,7 +127,7 @@ def add_sources(srclist, searchList={ }): source=ent['source'] if source.startswith("ppa:"): - try: util.subp(["add-apt-repository",source], "/dev/null") + try: util.subp(["add-apt-repository",source]) except: elst.append([source, "add-apt-repository failed"]) continue -- cgit v1.2.3