upgrade: treat duplicate entry when updating as not an error

When we attempt to update an entry during upgrade, it may have already
contain the data in question between the check and the update. Ignore
the change in this case and record it in the log.

Fixes: https://pagure.io/freeipa/issue/7450
Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
Alexander Bokovoy 2018-04-16 16:55:57 +03:00 committed by Christian Heimes
parent 7c8fd5630d
commit e16ea525e2

View File

@ -21,6 +21,7 @@
# TODO
# save undo files?
from __future__ import absolute_import
import base64
import logging
@ -849,6 +850,9 @@ class LDAPUpdate(object):
except errors.DatabaseError as e:
logger.error("Update failed: %s", e)
updated = False
except errors.DuplicateEntry as e:
logger.debug("Update already exists, skip it: %s", e)
updated = False
except errors.ACIError as e:
logger.error("Update failed: %s", e)
updated = False