diff options
-rw-r--r-- | ipaserver/install/ldapupdate.py | 9 | ||||
-rw-r--r-- | ipaserver/ipaldap.py | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/ipaserver/install/ldapupdate.py b/ipaserver/install/ldapupdate.py index e803df8a..61a2ae19 100644 --- a/ipaserver/install/ldapupdate.py +++ b/ipaserver/install/ldapupdate.py @@ -649,7 +649,14 @@ class LDAPUpdate: # addifexist may result in an entry with only a # dn defined. In that case there is nothing to do. # It means the entry doesn't exist, so skip it. - self.conn.addEntry(entry) + try: + self.conn.addEntry(entry) + except errors.NotFound: + # parent entry of the added entry does not exist + # this may not be an error (e.g. entries in NIS container) + root_logger.info("Parent DN of %s may not exist, cannot create the entry", + entry.dn) + return self.modified = True except Exception, e: root_logger.error("Add failure %s", e) diff --git a/ipaserver/ipaldap.py b/ipaserver/ipaldap.py index 23279aa0..8b5451c7 100644 --- a/ipaserver/ipaldap.py +++ b/ipaserver/ipaldap.py @@ -492,7 +492,7 @@ class IPAdmin(IPAEntryLDAPObject): self.set_option(ldap.OPT_SERVER_CONTROLS, sctrl) self.add_s(entry.dn, entry.toTupleList()) except ldap.LDAPError, e: - arg_desc = 'entry=%s' % (entry) + arg_desc = 'entry=%s' % (entry.toTupleList()) self.__handle_errors(e, arg_desc=arg_desc) return True |