From 2824c1755a0734df87afbf24c86ce1cadd6ccb54 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Apr 25 2018 12:08:58 +0000 Subject: 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 (cherry picked from commit 52c0d8c5bfc4d0c1fe8d8318edbf5909d139178c) Reviewed-By: Christian Heimes --- diff --git a/ipaserver/install/ldapupdate.py b/ipaserver/install/ldapupdate.py index c6ab3e2..4b57ff2 100644 --- a/ipaserver/install/ldapupdate.py +++ b/ipaserver/install/ldapupdate.py @@ -21,6 +21,7 @@ # TODO # save undo files? +from __future__ import absolute_import import base64 import sys @@ -812,6 +813,9 @@ class LDAPUpdate(object): except errors.DatabaseError as e: self.error("Update failed: %s", e) updated = False + except errors.DuplicateEntry as e: + self.debug("Update already exists, skip it: %s", e) + updated = False except errors.ACIError as e: self.error("Update failed: %s", e) updated = False