summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Bokovoy <abokovoy@redhat.com>2013-12-05 13:47:37 +0200
committerMartin Kosek <mkosek@redhat.com>2013-12-11 13:33:15 +0100
commit73e7a6c4099a10d25a9b0dd143d88185468fd74b (patch)
tree30df0a3b8a2f2252ebb8e6b53ec52d5c3286fa17
parent71481a0aa497a579ded42500b5b8f8c6807c825d (diff)
downloadfreeipa-73e7a6c4099a10d25a9b0dd143d88185468fd74b.tar.gz
freeipa-73e7a6c4099a10d25a9b0dd143d88185468fd74b.tar.xz
freeipa-73e7a6c4099a10d25a9b0dd143d88185468fd74b.zip
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
-rw-r--r--ipalib/plugins/trust.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ipalib/plugins/trust.py b/ipalib/plugins/trust.py
index 3b1b2fc6..76d609fd 100644
--- a/ipalib/plugins/trust.py
+++ b/ipalib/plugins/trust.py
@@ -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'