Skip to content

Commit

Permalink
upgrade: treat duplicate entry when updating as not an error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
abbra authored and tiran committed Apr 17, 2018
1 parent 34078ca commit 0925349
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ipaserver/install/ldapupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

# TODO
# save undo files?
from __future__ import absolute_import

import base64
import logging
Expand Down Expand Up @@ -849,6 +850,9 @@ def _update_record(self, update):
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
Expand Down

0 comments on commit 0925349

Please sign in to comment.