From 5d1536a7c509fd3ce292442e2dcf45d42a68e4f1 Mon Sep 17 00:00:00 2001 From: Juha Litola Date: Fri, 25 Jan 2013 13:29:39 +0200 Subject: [PATCH] Fixed add_key stalling indefinitely, and test code leaking into production setting --- apt_key | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apt_key b/apt_key index dcc4d12717f..8e521a4751a 100644 --- a/apt_key +++ b/apt_key @@ -105,7 +105,7 @@ def download_key(url): def add_key(key): - return call("apt-key add -", shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE) + p = Popen("apt-key add -", shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE) (_, _) = p.communicate(key) return p.returncode == 0 @@ -163,12 +163,12 @@ if 'ANSIBLE_TEST_APT_KEY' in environ: return extra -if environ.get('ANSIBLE_TEST_APT_KEY') == 'none': - def key_present(key_id): - return False -else: - def key_present(key_id): - return key_id == environ['ANSIBLE_TEST_APT_KEY'] + if environ.get('ANSIBLE_TEST_APT_KEY') == 'none': + def key_present(key_id): + return False + else: + def key_present(key_id): + return key_id == environ['ANSIBLE_TEST_APT_KEY'] def main():