mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
check_remote_version: update exception and docstring
Refactor function to use ScriptError exception and provide docstring. Reviewed-By: Martin Basti <mbasti@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com> Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
This commit is contained in:
parent
7292890042
commit
62e884ff7f
@ -512,6 +512,13 @@ def promote_openldap_conf(hostname, master):
|
||||
|
||||
|
||||
def check_remote_version(api):
|
||||
"""
|
||||
Perform a check to verify remote server's version
|
||||
|
||||
:param api: remote API
|
||||
|
||||
:raises: ``ScriptError`` if the checks fails
|
||||
"""
|
||||
client = rpc.jsonclient(api)
|
||||
client.finalize()
|
||||
|
||||
@ -524,7 +531,7 @@ def check_remote_version(api):
|
||||
remote_version = parse_version(env['version'])
|
||||
api_version = parse_version(api.env.version)
|
||||
if remote_version > api_version:
|
||||
raise RuntimeError(
|
||||
raise ScriptError(
|
||||
"Cannot install replica of a server of higher version ({}) than"
|
||||
"the local version ({})".format(remote_version, api_version))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user