mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-25 00:44:42 +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']
|
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():
|
|||||||
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)))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user