mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
upgrade: adtrust - catch empty result when retrieving list of trusts
Upgrade failure when ipa-server-upgrade is being run on a system with no trust established but trust configured Fixes: https://pagure.io/freeipa/issue/7939 Reviewed-By: François Cami <fcami@redhat.com>
This commit is contained in:
parent
5331510eab
commit
98b4c710d9
@ -609,11 +609,17 @@ class update_tdo_to_new_layout(Updater):
|
|||||||
|
|
||||||
trusts_dn = self.api.env.container_adtrusts + self.api.env.basedn
|
trusts_dn = self.api.env.container_adtrusts + self.api.env.basedn
|
||||||
|
|
||||||
trusts = ldap.get_entries(
|
# We might be in a situation when no trusts exist yet
|
||||||
base_dn=trusts_dn,
|
# In such case there is nothing to upgrade but we have to catch
|
||||||
scope=ldap.SCOPE_ONELEVEL,
|
# an exception or it will abort the whole upgrade process
|
||||||
filter=self.trust_filter,
|
try:
|
||||||
attrs_list=self.trust_attrs)
|
trusts = ldap.get_entries(
|
||||||
|
base_dn=trusts_dn,
|
||||||
|
scope=ldap.SCOPE_ONELEVEL,
|
||||||
|
filter=self.trust_filter,
|
||||||
|
attrs_list=self.trust_attrs)
|
||||||
|
except errors.EmptyResult:
|
||||||
|
trusts = []
|
||||||
|
|
||||||
# For every trust, retrieve its principals and convert
|
# For every trust, retrieve its principals and convert
|
||||||
for t_entry in trusts:
|
for t_entry in trusts:
|
||||||
|
Loading…
Reference in New Issue
Block a user