summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Krizek <tkrizek@redhat.com>2017-02-06 17:17:49 +0100
committerMartin Basti <mbasti@redhat.com>2017-02-21 17:09:00 +0100
commit62e884ff7f037a28a15d61cc9fa9c46e5c40cda5 (patch)
tree542204909c86807484616d60b4b329a47fa49d56
parent7292890042677ae40faa44753ebf570db6c19e7c (diff)
downloadfreeipa-62e884ff7f037a28a15d61cc9fa9c46e5c40cda5.tar.gz
freeipa-62e884ff7f037a28a15d61cc9fa9c46e5c40cda5.tar.xz
freeipa-62e884ff7f037a28a15d61cc9fa9c46e5c40cda5.zip
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>
-rw-r--r--ipaserver/install/server/replicainstall.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/ipaserver/install/server/replicainstall.py b/ipaserver/install/server/replicainstall.py
index 84e86a9bc..77e1caab7 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))