mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
migrate-ds: exit with error message if no users/groups to migrate are found
'ipa migrate-ds' will now exit with error message if no suitable users/groups are found on LDAP server during migration. https://fedorahosted.org/freeipa/ticket/4846 Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
parent
373a04870d
commit
06376a48b2
@ -841,6 +841,12 @@ can use their Kerberos accounts.''')
|
||||
api.log.info("%d %ss migrated. %s elapsed." % (migrate_cnt, ldap_obj_name, total_dur))
|
||||
api.log.debug("%d %ss migrated, duration: %s (total %s)" % (migrate_cnt, ldap_obj_name, d, total_dur))
|
||||
|
||||
# if no users/groups were found (all lists in 'migrated' are empty),
|
||||
# we raise an error that there is nothing to migrate
|
||||
if not any(migrated.values()):
|
||||
raise errors.NotFound(
|
||||
reason=_("Found no users/groups to migrate "
|
||||
"from '%(ds_ldap)s'.") % dict(ds_ldap=ds_ldap))
|
||||
_update_default_group(ldap, pkey, config, context, True)
|
||||
|
||||
return (migrated, failed)
|
||||
|
Loading…
Reference in New Issue
Block a user