mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
service: handle empty list of services to update their state
When there are no services in LDAP that have specified states, we don't need to update their state. Fixes: https://pagure.io/freeipa/issue/8623 Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com> Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
parent
35362d3033
commit
b7c00f2a1f
@ -252,12 +252,18 @@ def _set_services_state(fqdn, dest_state):
|
||||
rules=ldap2.MATCH_ALL
|
||||
)
|
||||
|
||||
try:
|
||||
entries = ldap2.get_entries(
|
||||
search_base,
|
||||
filter=search_filter,
|
||||
scope=api.Backend.ldap2.SCOPE_ONELEVEL,
|
||||
attrs_list=['cn', 'ipaConfigString']
|
||||
)
|
||||
except errors.EmptyResult:
|
||||
logger.debug("No services with a state from %s, ignoring",
|
||||
list(source_states))
|
||||
return
|
||||
|
||||
for entry in entries:
|
||||
name = entry['cn']
|
||||
cfgstrings = entry.setdefault('ipaConfigString', [])
|
||||
|
Loading…
Reference in New Issue
Block a user