From c339abbad1e82a264afc5cf9efa3aff80814aeaf Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Tue, 3 Nov 2015 10:37:15 +0100 Subject: [PATCH] Use domain level constants in topology plugin Reviewed-By: David Kupka --- ipalib/plugins/topology.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ipalib/plugins/topology.py b/ipalib/plugins/topology.py index 2b82215e2..2c43758c3 100644 --- a/ipalib/plugins/topology.py +++ b/ipalib/plugins/topology.py @@ -12,6 +12,7 @@ from ipalib.plugins.baseldap import ( LDAPRetrieve) from ipalib import _, ngettext from ipalib import output +from ipalib.constants import DOMAIN_LEVEL_1 from ipalib.util import create_topology_graph, get_topology_connection_errors from ipapython.dn import DN @@ -28,15 +29,13 @@ Requires minimum domain level 1. register = Registry() -MINIMUM_DOMAIN_LEVEL = 1 - def validate_domain_level(api): current = int(api.Command.domainlevel_get()['result']) - if current < MINIMUM_DOMAIN_LEVEL: + if current < DOMAIN_LEVEL_1: raise errors.InvalidDomainLevelError( reason=_('Topology management requires minimum domain level {0} ' - .format(MINIMUM_DOMAIN_LEVEL)) + .format(DOMAIN_LEVEL_1)) )