mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-07 05:43:26 +00:00
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.
This commit is contained in:
@@ -977,12 +977,14 @@ def main():
|
||||
changed = 'Archived data into' in result['summary']
|
||||
elif command == 'vault_retrieve':
|
||||
if 'result' not in result:
|
||||
# pylint: disable=W0012,broad-exception-raised
|
||||
raise Exception("No result obtained.")
|
||||
if "data" in result["result"]:
|
||||
data_return = exit_args.setdefault("vault", {})
|
||||
data_return["data"] = result["result"]["data"]
|
||||
else:
|
||||
if not datafile_out:
|
||||
# pylint: disable=W0012,broad-exception-raised
|
||||
raise Exception("No data retrieved.")
|
||||
changed = False
|
||||
else:
|
||||
@@ -993,7 +995,7 @@ def main():
|
||||
changed = True
|
||||
except ipalib_errors.EmptyModlist:
|
||||
result = {}
|
||||
except Exception as exception:
|
||||
except Exception as exception: # pylint: disable=broad-except
|
||||
ansible_module.fail_json(
|
||||
msg="%s: %s: %s" % (command, name, str(exception)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user