mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
trustdomain-del: fix the way how subdomain is searched
With FreeIPA 4.4 we moved child domains behind the 'trustdomain' topic. Update 'ipa trustdomain-del' command to properly calculate DN to the actual child domain and handle the case when it is missing correctly. Fixes https://fedorahosted.org/freeipa/ticket/6445 Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
This commit is contained in:
parent
842bf3d09f
commit
e8b94ef352
@ -1614,13 +1614,16 @@ class trustdomain_del(LDAPDelete):
|
|||||||
# to always receive empty keys. We need to catch the case when root domain is being deleted
|
# to always receive empty keys. We need to catch the case when root domain is being deleted
|
||||||
|
|
||||||
for domain in keys[1]:
|
for domain in keys[1]:
|
||||||
# Fetch the trust to verify that the entered domain is trusted
|
try:
|
||||||
self.api.Command.trust_show(domain)
|
self.obj.get_dn_if_exists(keys[0], domain, trust_type=u'ad')
|
||||||
|
except errors.NotFound:
|
||||||
if keys[0].lower() == domain:
|
if keys[0].lower() == domain:
|
||||||
raise errors.ValidationError(name='domain',
|
raise errors.ValidationError(
|
||||||
|
name='domain',
|
||||||
error=_("cannot delete root domain of the trust, "
|
error=_("cannot delete root domain of the trust, "
|
||||||
"use trust-del to delete the trust itself"))
|
"use trust-del to delete the trust itself"))
|
||||||
|
self.obj.handle_not_found(keys[0], domain)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.api.Command.trustdomain_enable(keys[0], domain)
|
self.api.Command.trustdomain_enable(keys[0], domain)
|
||||||
except errors.AlreadyActive:
|
except errors.AlreadyActive:
|
||||||
|
Loading…
Reference in New Issue
Block a user