From 62e884ff7f037a28a15d61cc9fa9c46e5c40cda5 Mon Sep 17 00:00:00 2001 From: Tomas Krizek Date: Feb 21 2017 16:09:00 +0000 Subject: check_remote_version: update exception and docstring Refactor function to use ScriptError exception and provide docstring. Reviewed-By: Martin Basti Reviewed-By: Jan Cholasta Reviewed-By: Stanislav Laznicka --- diff --git a/ipaserver/install/server/replicainstall.py b/ipaserver/install/server/replicainstall.py index 84e86a9..77e1caa 100644 --- a/ipaserver/install/server/replicainstall.py +++ b/ipaserver/install/server/replicainstall.py @@ -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))