Univention Bugzilla – Bug 12964
traceback when value provided by --append is already set
Last modified: 2018-04-13 13:29:34 CEST
univention-admin settings/printermodel modify --ignore_exists --dn cn=HP,cn=cups,cn=univention,dc=uni --append 'printmodel="bla" "bla"' und dann nochmal univention-admin settings/printermodel modify --ignore_exists --dn cn=HP,cn=cups,cn=univention,dc=uni --append 'printmodel="bla" "bla"' Traceback (most recent call last): File "/usr/share/univention-directory-manager-tools/univention-cli-server", line 231, in doit output = univention.admincli.admin.doit(arglist) File "/usr/lib/python2.4/site-packages/univention/admincli/admin.py", line 894, in doit dn=object.modify() File "/usr/lib/python2.4/site-packages/univention/admin/handlers/__init__.py", line 302, in modify return self._modify(modify_childs,ignore_license=ignore_license) File "/usr/lib/python2.4/site-packages/univention/admin/handlers/__init__.py", line 657, in _modify self.lo.modify(self.dn, ml, ignore_license=ignore_license) File "/usr/lib/python2.4/site-packages/univention/admin/uldap.py", line 353, in modify raise univention.admin.uexceptions.ldapError, msg[0]['desc'] ldapError: Type or value exists mir ist dann im updater.log ausgefallen, dort versucht das join script des univention-prinserver so etwas
*** Bug 18893 has been marked as a duplicate of this bug. ***
Da wird die Exception ldap.TYPE_OR_VALUE_EXISTS geworfen, das ist noch nicht in uldap.py/uexceptions.py gemapped. Es sollte dann vor einer Anpassung des Verhaltens geprüft werden, ob es sinnvoll ist das so zu implementieren, dass ein modify mit mehreren --append die Modifikationen durchführt die fehlerfrei möglich sind und für die ignorierten Modifikationen (jeweils?!) eine Meldung auszugeben.
Das Verhalten tritt auch auf, wenn ein Benutzer bereits in einer Gruppe ist: root@master101:~# udm groups/group modify "$@" --ignore_exists --dn "cn=Group Policy Creator Owners,cn=groups,$ldap_base" --append users="uid=administrator,CN=Users,$ldap_base" Traceback (most recent call last): File "/usr/share/univention-directory-manager-tools/univention-cli-server", line 233, in doit output = univention.admincli.admin.doit(arglist) File "/usr/lib/pymodules/python2.6/univention/admincli/admin.py", line 938, in doit dn=object.modify() File "/usr/lib/pymodules/python2.6/univention/admin/handlers/__init__.py", line 344, in modify return self._modify(modify_childs,ignore_license=ignore_license) File "/usr/lib/pymodules/python2.6/univention/admin/handlers/__init__.py", line 863, in _modify self.lo.modify(self.dn, ml, ignore_license=ignore_license) File "/usr/lib/pymodules/python2.6/univention/admin/uldap.py", line 385, in modify raise univention.admin.uexceptions.ldapError, _err2str(msg) ldapError: Type or value exists: modify/add: uniqueMember: value #0 already exists root@master101:~#
The option "--ignore-exists" means "ignore if that object already exists". The option "--ignore-exists" doesn't exists for the modify operation! The option "--ignore-exists" does NOT mean ignore if all the provided values are already set. Nevertheless we often have troubles when we want to append a value where we are not sure if this is already set. The best case would to just print a WARNING for each already set value.
Another one: # udm policies/registry create --set name=test --append registry="foo bar" Object created: cn=test,dc=school,dc=local # udm policies/registry modify --dn "cn=test,$(ucr get ldap/base)" --append registry="foo bar" E: Invalid Syntax: Duplicated variables not allowed: 'foo'
*** Bug 28756 has been marked as a duplicate of this bug. ***
Bug #32638 might be a duplicate.
groups/groups has been fixed in Bug #43247
The patch in Bug #43286 will also fix this. *** This bug has been marked as a duplicate of bug 43286 ***