mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-08 06:13:21 +00:00
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:
@@ -307,8 +307,7 @@ try:
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
# IPA version < 4.4
|
# IPA version < 4.4
|
||||||
|
raise RuntimeError("freeipa version '%s' is too old" % VERSION)
|
||||||
raise Exception("freeipa version '%s' is too old" % VERSION)
|
|
||||||
|
|
||||||
except ImportError as _err:
|
except ImportError as _err:
|
||||||
ANSIBLE_IPA_CLIENT_MODULE_IMPORT_ERROR = str(_err)
|
ANSIBLE_IPA_CLIENT_MODULE_IMPORT_ERROR = str(_err)
|
||||||
|
|||||||
@@ -171,8 +171,7 @@ try:
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
# IPA version < 4.6
|
# IPA version < 4.6
|
||||||
|
raise RuntimeError("freeipa version '%s' is too old" % VERSION)
|
||||||
raise Exception("freeipa version '%s' is too old" % VERSION)
|
|
||||||
|
|
||||||
except ImportError as _err:
|
except ImportError as _err:
|
||||||
ANSIBLE_IPA_REPLICA_MODULE_IMPORT_ERROR = str(_err)
|
ANSIBLE_IPA_REPLICA_MODULE_IMPORT_ERROR = str(_err)
|
||||||
|
|||||||
@@ -212,8 +212,7 @@ try:
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
# IPA version < 4.5
|
# IPA version < 4.5
|
||||||
|
raise RuntimeError("freeipa version '%s' is too old" % VERSION)
|
||||||
raise Exception("freeipa version '%s' is too old" % VERSION)
|
|
||||||
|
|
||||||
except ImportError as _err:
|
except ImportError as _err:
|
||||||
ANSIBLE_IPA_SERVER_MODULE_IMPORT_ERROR = str(_err)
|
ANSIBLE_IPA_SERVER_MODULE_IMPORT_ERROR = str(_err)
|
||||||
|
|||||||
Reference in New Issue
Block a user