summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/ldapupdate.py
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2015-07-21 18:13:44 +0200
committerMartin Basti <mbasti@redhat.com>2015-09-21 12:04:12 +0200
commite7713d45a4277901d8663c54893de48f8f6d5796 (patch)
tree8ba9e1771d8d3456333307d6961d8db878b96df4 /ipaserver/install/ldapupdate.py
parenta4b1bb25c98a6d2b94a89cefa619b75656551b60 (diff)
downloadfreeipa-e7713d45a4277901d8663c54893de48f8f6d5796.tar.gz
freeipa-e7713d45a4277901d8663c54893de48f8f6d5796.tar.xz
freeipa-e7713d45a4277901d8663c54893de48f8f6d5796.zip
Server Upgrade: addifnew should not create entry
addifnew should add value only if entry exists, instead of creating entry. Reviewed-By: David Kupka <dkupka@redhat.com>
Diffstat (limited to 'ipaserver/install/ldapupdate.py')
-rw-r--r--ipaserver/install/ldapupdate.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ipaserver/install/ldapupdate.py b/ipaserver/install/ldapupdate.py
index 4457edc4c..5fac58eca 100644
--- a/ipaserver/install/ldapupdate.py
+++ b/ipaserver/install/ldapupdate.py
@@ -663,8 +663,8 @@ class LDAPUpdate:
elif action == 'addifnew':
self.debug("addifnew: '%s' to %s, current value %s", safe_output(attr, update_value), attr, safe_output(attr, entry_values))
# Only add the attribute if it doesn't exist. Only works
- # with single-value attributes.
- if len(entry_values) == 0:
+ # with single-value attributes. Entry must exist.
+ if entry.get('objectclass') and len(entry_values) == 0:
entry_values.append(update_value)
self.debug('addifnew: set %s to %s', attr, safe_output(attr, entry_values))
entry[attr] = entry_values