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