From c475814519614a066b29776a271ba95f0fe46ab8 Mon Sep 17 00:00:00 2001 From: Jens Rantil Date: Wed, 4 Dec 2013 13:56:57 +0100 Subject: [PATCH 1/2] module(apt_key): don't catch `SystemExit` If we do this, we risk outputting two JSON payloads, which will be unparsable. --- packaging/apt_key | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/apt_key b/packaging/apt_key index 17b52888d47..dee73762c62 100644 --- a/packaging/apt_key +++ b/packaging/apt_key @@ -138,7 +138,7 @@ def download_key(module, url): module.fail_json("error connecting to download key from url") data = connection.read() return data - except: + except Exception: module.fail_json(msg="error getting key id from url", traceback=format_exc()) From 71590827ab385f916e59c754e2fb03dab6dfe5eb Mon Sep 17 00:00:00 2001 From: Jens Rantil Date: Wed, 4 Dec 2013 13:55:16 +0100 Subject: [PATCH 2/2] module(nagios): don't catch `SystemExit` If we do this, we risk outputting two JSON payloads, which will be unparsable. --- monitoring/nagios | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitoring/nagios b/monitoring/nagios index a66583b0c62..9219766b86a 100644 --- a/monitoring/nagios +++ b/monitoring/nagios @@ -214,7 +214,7 @@ def main(): m = int(minutes) if not isinstance(m, types.IntType): module.fail_json(msg='minutes must be a number') - except: + except Exception: module.fail_json(msg='invalid entry for minutes') ##################################################################