diff --git a/library/monitoring/nagios b/library/monitoring/nagios index a66583b0c6..9219766b86 100644 --- a/library/monitoring/nagios +++ b/library/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') ################################################################## diff --git a/library/packaging/apt_key b/library/packaging/apt_key index 17b52888d4..dee73762c6 100644 --- a/library/packaging/apt_key +++ b/library/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())