Univention Bugzilla – Bug 33482
Move of sub ou with RSAT tools leads to rejects
Last modified: 2018-09-13 13:27:42 CEST
I've creates ou=users,ou=MSWATT,<base> containing some users and an empty ou=NoWatt,<base>. With RSAT tools I moved ou=users,ou=MSWATT,<base> to ou=NoWatt,<base>: 20.11.2013 10:45:05,663 LDAP (PROCESS): sync to ucs: [ ou] [ move] OU=users,ou=nowatt,dc=testing,dc=tim 20.11.2013 10:45:05,737 LDAP (ERROR ): Unknown Exception during sync_to_ucs 20.11.2013 10:45:05,759 LDAP (ERROR ): Traceback (most recent call last): File "/usr/lib/pymodules/python2.6/univention/s4connector/__init__.py", line 1306, in sync_to_ucs result = self.move_in_ucs(property_type, object, module, position) File "/usr/lib/pymodules/python2.6/univention/s4connector/__init__.py", line 1196, in move_in_ucs ucs_object.move(object['dn']) File "/usr/lib/pymodules/python2.6/univention/admin/handlers/__init__.py", line 396, in move subobject.move(subnewdn) File "/usr/lib/pymodules/python2.6/univention/admin/handlers/__init__.py", line 358, in move raise univention.admin.uexceptions.ldapError, _('Moving not possible: old and new DN are identical.') ldapError: Moving not possible: old and new DN are identical.
We should also check a backport for UCS 3.1.
The problems seems to be in modules/univention/admin/handlers/__init__.py about line 388. The code tries this: subnewdn = subolddn.replace(self.dn,newdn) These are the values in my example: subolddn: uid=user_test_h80,ou=TEST_H81,BASE self.dn: ou=test_h81,BASE newdn: OU=TEST_H81,ou=test_h82,BASE I'm currently unsure why this works via UDM CLI.
Move to UDM.
*** Bug 25113 has been marked as a duplicate of this bug. ***
*** Bug 31994 has been marked as a duplicate of this bug. ***
(In reply to Stefan Gohmann from comment #2) > The problems seems to be in modules/univention/admin/handlers/__init__.py > about line 388. The code tries this: > subnewdn = subolddn.replace(self.dn,newdn) > > These are the values in my example: > subolddn: uid=user_test_h80,ou=TEST_H81,BASE > self.dn: ou=test_h81,BASE > newdn: OU=TEST_H81,ou=test_h82,BASE > > I'm currently unsure why this works via UDM CLI. It works via UDM CLI because it uses always the same upper and lower case. If it comes from the external lib for example the ldap base is not always the same. There are more errors in this area, for example the rename from lower to upper case. It is allowed in AD / S4 but not in OpenLDAP. For this a move to a temporary folder would be the best.
It should also be possible to rename a cn / ou from upper to lowercase and vice versa. I've added some test cases: - 52_s4connector/189sync_ad_rename_container - 52_s4connector/199sync_ad_move_ou_casemix - 52_s4connector/199sync_ad_rename_ou - 63_udm-containers/06_container_ou_rename - 63_udm-containers/07_container_ou_rename_uppercase - 63_udm-containers/08_container_ou_rename_uppercase_rollback - 63_udm-containers/16_container_cn_rename - 63_udm-containers/17_container_cn_rename_uppercase - 63_udm-containers/18_container_cn_rename_uppercase_rollback Code changes: r46320 + r46326 + r46437 + r46440 YAML: 2013-11-26-univention-directory-manager-modules.yaml
(In reply to Stefan Gohmann from comment #7) > I've added some test cases: > - 63_udm-containers/06_container_ou_rename > - 63_udm-containers/07_container_ou_rename_uppercase > - 63_udm-containers/08_container_ou_rename_uppercase_rollback > - 63_udm-containers/16_container_cn_rename > - 63_udm-containers/17_container_cn_rename_uppercase > - 63_udm-containers/18_container_cn_rename_uppercase_rollback I added/extended the tests and now they fail: * Renaming a subcontainer of a container fails if it is just uppercase change * Renaming an empty container leaves a stall "temporary_move_container_*"
OK, theses issues have been fixed: r46598
Code: unused: new_position = ','.join(ldap.explode_dn(newdn)[1:]) try/finally around the last (big) part of move()? self._delete_temporary_ou_if_empty('%s,%s' %(temp_container,self.lo.base)) return value: move returns whatever self._move() returns normally. But not in the new subtree_moving part. _move() returns None, though, I do not know if ignoring the return value is an issue. Test: FAIL when using up/mixed case objects in subtree, e.g. uid=Administrator
(In reply to Dirk Wiesenthal from comment #10) > Code: > unused: > new_position = ','.join(ldap.explode_dn(newdn)[1:]) removed > try/finally around the last (big) part of move()? > self._delete_temporary_ou_if_empty('%s,%s' > %(temp_container,self.lo.base)) I don't think it makes the code more readable. I moved it into a single function. > return value: > move returns whatever self._move() returns normally. But not in the new > subtree_moving part. _move() returns None, though, I do not know if ignoring > the return value is an issue. I have preserved the previous behavior. We shouldn't change it in this bug scope. > Test: > FAIL when using up/mixed case objects in subtree, e.g. uid=Administrator Yes, fixed with r46616 + r46619
Code works Tests passed YAML ok The error described here (different cases in containers) should be fixed by now. I opened Bug#33725 for the same problem in users, computers, groups (but this is a different mechanism).
*** Bug 33567 has been marked as a duplicate of this bug. ***
http://errata.univention.de/ucs/3.2/12.html