Skip to content
Snippets Groups Projects
Commit d0a8005a authored by Rafael Guterres Jeffman's avatar Rafael Guterres Jeffman
Browse files

pylint: Disable broad exception warnings

In recent pylint versions, use of broad exceptions for both raise and
try/except blocks raise a linter warning. As its use is justifiable in
the case of ipavault, the warnings are disabled where they occur.
parent 24efad73
No related branches found
No related tags found
No related merge requests found
...@@ -977,12 +977,14 @@ def main(): ...@@ -977,12 +977,14 @@ def main():
changed = 'Archived data into' in result['summary'] changed = 'Archived data into' in result['summary']
elif command == 'vault_retrieve': elif command == 'vault_retrieve':
if 'result' not in result: if 'result' not in result:
# pylint: disable=W0012,broad-exception-raised
raise Exception("No result obtained.") raise Exception("No result obtained.")
if "data" in result["result"]: if "data" in result["result"]:
data_return = exit_args.setdefault("vault", {}) data_return = exit_args.setdefault("vault", {})
data_return["data"] = result["result"]["data"] data_return["data"] = result["result"]["data"]
else: else:
if not datafile_out: if not datafile_out:
# pylint: disable=W0012,broad-exception-raised
raise Exception("No data retrieved.") raise Exception("No data retrieved.")
changed = False changed = False
else: else:
...@@ -993,7 +995,7 @@ def main(): ...@@ -993,7 +995,7 @@ def main():
changed = True changed = True
except ipalib_errors.EmptyModlist: except ipalib_errors.EmptyModlist:
result = {} result = {}
except Exception as exception: except Exception as exception: # pylint: disable=broad-except
ansible_module.fail_json( ansible_module.fail_json(
msg="%s: %s: %s" % (command, name, str(exception))) msg="%s: %s: %s" % (command, name, str(exception)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment