summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2015-07-20 13:49:41 +0200
committerTomas Babej <tbabej@redhat.com>2015-07-20 13:53:21 +0200
commit37b1af9a7cea72f41ac468ab80259f39b0a7b3db (patch)
tree159e9c9fca7e95265823b5c0c2c60abd7ab0094d /ipalib/plugins
parentc6c84faecf5b7017c0d648d76ba0db4a2eba2f03 (diff)
downloadfreeipa-37b1af9a7cea72f41ac468ab80259f39b0a7b3db.tar.gz
freeipa-37b1af9a7cea72f41ac468ab80259f39b0a7b3db.tar.xz
freeipa-37b1af9a7cea72f41ac468ab80259f39b0a7b3db.zip
domainlevel: Fix incorrect initializations of InvalidDomainLevelError exceptions
Reviewed-By: Tomas Babej <tbabej@redhat.com>
Diffstat (limited to 'ipalib/plugins')
-rw-r--r--ipalib/plugins/domainlevel.py4
-rw-r--r--ipalib/plugins/topology.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/ipalib/plugins/domainlevel.py b/ipalib/plugins/domainlevel.py
index 64e383006..838a518e7 100644
--- a/ipalib/plugins/domainlevel.py
+++ b/ipalib/plugins/domainlevel.py
@@ -120,7 +120,7 @@ class domainlevel_set(Command):
# Domain level cannot be lowered
if int(desired_value) < int(current_value):
message = _("Domain Level cannot be lowered.")
- raise errors.InvalidDomainLevelError(message)
+ raise errors.InvalidDomainLevelError(reason=message)
# Check if every master supports the desired level
for master in get_master_entries(ldap, self.api):
@@ -130,7 +130,7 @@ class domainlevel_set(Command):
message = _("Domain Level cannot be raised to {0}, server {1} "
"does not support it."
.format(desired_value, master['cn'][0]))
- raise errors.InvalidDomainLevelError(message)
+ raise errors.InvalidDomainLevelError(reason=message)
current_entry.single_value['ipaDomainLevel'] = desired_value
ldap.update_entry(current_entry)
diff --git a/ipalib/plugins/topology.py b/ipalib/plugins/topology.py
index de5ceb975..2723ce121 100644
--- a/ipalib/plugins/topology.py
+++ b/ipalib/plugins/topology.py
@@ -31,8 +31,8 @@ def validate_domain_level(api):
current = int(api.Command.domainlevel_get()['result'])
if current < MINIMUM_DOMAIN_LEVEL:
raise errors.InvalidDomainLevelError(
- _('Topology management requires minimum domain level {0} '
- .format(MINIMUM_DOMAIN_LEVEL))
+ reason=_('Topology management requires minimum domain level {0} '
+ .format(MINIMUM_DOMAIN_LEVEL))
)