From 51f46b7acd00b324e66e5fffd8646a48dc70aa2d Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Thu, 5 Dec 2013 13:47:37 +0200 Subject: [PATCH 13/14] 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 --- ipalib/plugins/trust.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ipalib/plugins/trust.py b/ipalib/plugins/trust.py index 3b1b2fc67ce333751556a5c3a59a7f89efc608f9..76d609fd4de33edd96715deaaf7842c1de3ddaf4 100644 --- a/ipalib/plugins/trust.py +++ b/ipalib/plugins/trust.py @@ -262,7 +262,7 @@ def get_dn(self, *keys, **kwargs): 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' -- 1.8.4.2