Update bare exceptions to specify Exception.

This will keep us from accidentally catching program-exiting exceptions
like KeyboardInterupt and SystemExit.
This commit is contained in:
Toshio Kuratomi 2018-09-07 17:59:46 -07:00
commit 3fba006207
320 changed files with 659 additions and 656 deletions

View file

@ -147,7 +147,7 @@ def content_to_dict(module, content):
if not content_dict:
raise Exception()
except:
except Exception:
module.fail_json(msg="Unable to convert 'content' to a dict, please check if valid")
# replace the string with the dict
@ -163,7 +163,7 @@ def do_load_resource(module, collection, name):
try:
item = find_collection_item(collection, name, '')
except:
except Exception:
module.fail_json(msg="An error occurred while running 'find_collection_item'")
if item.exists: