diff options
author | Martin Basti <mbasti@redhat.com> | 2015-10-26 17:56:57 +0100 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2015-10-27 10:29:41 +0100 |
commit | beb6a3236d5c10acd990aaf92eddc74fee456909 (patch) | |
tree | 34aec12aeb6528788a4c5cc37cfdae7dcedfcec0 /install/tools/ipa-replica-manage | |
parent | 5ab0fcabf3e6ac7970c1803893717301a4b4cfe8 (diff) | |
download | freeipa-beb6a3236d5c10acd990aaf92eddc74fee456909.tar.gz freeipa-beb6a3236d5c10acd990aaf92eddc74fee456909.tar.xz freeipa-beb6a3236d5c10acd990aaf92eddc74fee456909.zip |
Domain levels: use constants rather than hardcoded values
Added constants for domain levels
DOMAIN_LEVEL_0 = 0
DOMAIN_LEVEL_1 = 1
This allows to search for domain level easier in code.
Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Tomas Babej <tbabej@redhat.com>
Diffstat (limited to 'install/tools/ipa-replica-manage')
-rwxr-xr-x | install/tools/ipa-replica-manage | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/install/tools/ipa-replica-manage b/install/tools/ipa-replica-manage index c01092d53..1350590b6 100755 --- a/install/tools/ipa-replica-manage +++ b/install/tools/ipa-replica-manage @@ -37,7 +37,7 @@ from ipaserver.install import bindinstance, cainstance, certs from ipaserver.install import opendnssecinstance, dnskeysyncinstance from ipapython import version, ipaldap from ipalib import api, errors, util -from ipalib.constants import CACERT +from ipalib.constants import CACERT, DOMAIN_LEVEL_0 from ipalib.util import create_topology_graph, get_topology_connection_errors from ipapython.ipa_log_manager import * from ipapython.dn import DN @@ -804,7 +804,8 @@ def del_master_managed(realm, hostname, options): def del_master_direct(realm, hostname, options): """ - Removing of master for realm without managed topology (domain level < 1) + Removing of master for realm without managed topology + (domain level < DOMAIN_LEVEL_1) """ force_del = False @@ -1349,8 +1350,8 @@ def set_DNA_range(hostname, range, realm, dirman_passwd, next_range=False, sys.exit("Updating range failed: %s" % e) def has_managed_topology(): - domainlevel = api.Command['domainlevel_get']().get('result', 0) - return domainlevel > 0 + domainlevel = api.Command['domainlevel_get']().get('result', DOMAIN_LEVEL_0) + return domainlevel > DOMAIN_LEVEL_0 def exit_on_managed_topology(what): sys.exit("{0} is deprecated with managed IPA replication topology. " |