Change 'Exception' to 'RuntimeError' when FreeIPA version is too old

Changing the use of 'Exception' to 'RuntimeError' has the benefits of
making the error more specific and meaningful for what is being reported
and to remove warnings from linters (pylint).

The same change is applied to all deployment roles.
This commit is contained in:
Rafael Guterres Jeffman
2023-07-12 18:36:48 -03:00
parent d0a8005a7f
commit 63d0272385
3 changed files with 3 additions and 6 deletions

View File

@@ -212,8 +212,7 @@ try:
else:
# IPA version < 4.5
raise Exception("freeipa version '%s' is too old" % VERSION)
raise RuntimeError("freeipa version '%s' is too old" % VERSION)
except ImportError as _err:
ANSIBLE_IPA_SERVER_MODULE_IMPORT_ERROR = str(_err)