mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
trust: fix get_dn() to distinguish creating and re-adding trusts
Latest support for subdomains introduced regression that masked difference between newly added trust and re-added one. Additionally, in case no new subdomains were found, the code was returning None instead of an empty list which later could confuse trustdomain-find command. https://fedorahosted.org/freeipa/ticket/4067
This commit is contained in:
parent
71481a0aa4
commit
73e7a6c409
@ -262,7 +262,7 @@ class trust(LDAPObject):
|
||||
result = ldap.get_entries(DN(self.container_dn, self.env.basedn),
|
||||
ldap.SCOPE_SUBTREE, filter, [''])
|
||||
except errors.NotFound:
|
||||
trust_type = u'ad'
|
||||
return None
|
||||
else:
|
||||
if len(result) > 1:
|
||||
raise errors.OnlyOneValueAllowed(attr='trust domain')
|
||||
@ -1244,7 +1244,7 @@ def fetch_domains_from_trust(self, trustinstance, trust_entry, **options):
|
||||
trust_name, creds=creds)
|
||||
result = []
|
||||
if not domains:
|
||||
return None
|
||||
return result
|
||||
|
||||
for dom in domains:
|
||||
dom['trust_type'] = u'ad'
|
||||
|
Loading…
Reference in New Issue
Block a user