Bug 32401 - ucs_registerUDMHook library function
ucs_registerUDMHook library function
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: univention-lib
UCS 3.2
Other Linux
: P5 normal (vote)
: UCS 3.2
Assigned To: Arvid Requate
Stefan Gohmann
: interim-3
Depends on: 32403
Blocks: 32421
  Show dependency treegraph
 
Reported: 2013-08-28 14:06 CEST by Arvid Requate
Modified: 2014-03-20 16:24 CET (History)
1 user (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Requate univentionstaff 2013-08-28 14:06:17 CEST
A function ucs_registerUDMHook schould be implemented in univention-lib which

* takes the name of an existing UDM hook file
* creates an univentionUDMHook object in UDM
* saves the given file to the UDM property "univentionUDMHook"
* sets the UDM property "univentionUDMHookFilename"
* sets some other attributes useful to track creator package and version number.

* The creator package (.deb) and version number is detected automatically.
* The cn schould reflect <basename of the file>_<version number>.
Comment 1 Arvid Requate univentionstaff 2013-08-28 16:18:55 CEST
The string <AppID>_<AppVersion> should be stored in an attribute univentionAppIdentifier as tracking reference e.g. for Bug 32418.
Comment 2 Arvid Requate univentionstaff 2013-08-28 16:41:55 CEST
ucs_unregisterUDMHook is also required (e.g. for unjoinscripts), to remove the object in case no App is registered any longer for it.
Comment 3 Arvid Requate univentionstaff 2013-09-10 16:38:46 CEST
Implemented in shell-univention-lib. Changelog comitted.
Comment 4 Arvid Requate univentionstaff 2013-09-16 18:03:03 CEST
Now merged into more general functions:

ucs_registerLDAPExtension "$@" --udm_hook <filename>

ucs_unregisterLDAPExtension "$@" --udm_hook <objectname>
Comment 5 Sönke Schwardt-Krummrich univentionstaff 2013-09-19 15:33:12 CEST
univention-lib/python$ pyflakes ldap_extension.py
ldap_extension.py:291: undefined name 'name'
ldap_extension.py:295: undefined name 'name'
ldap_extension.py:976: local variable 'objects' is assigned to but never used
Comment 6 Stefan Gohmann univentionstaff 2013-09-19 20:44:07 CEST
Fixed with r44253

(In reply to Sönke Schwardt-Krummrich from comment #5)
> univention-lib/python$ pyflakes ldap_extension.py
> ldap_extension.py:291: undefined name 'name'
> ldap_extension.py:295: undefined name 'name'

I decided to remove "name" from the output string.

> ldap_extension.py:976: local variable 'objects' is assigned to but never used

Removed the variable.
Comment 7 Sönke Schwardt-Krummrich univentionstaff 2013-09-26 14:34:09 CEST
ucs_registerLDAPExtension does not write UNIVENTION_APP_IDENTIFIER to LDAP.
Setting the app identifier via UDM CLI seems to work flawlessly
→ found by ucs-test 04_register_and_verify_test_app_id
→ REOPEN

ucs_registerLDAPExtension does not write version start and version end to LDAP.
Setting the range via UDM CLI seems to work flawlessly
→ found by ucs-test 05_register_and_verify_version_start_end
→ REOPEN

ucs_registerLDAPExtension does not compare the package versions correctly. The new package always seems to have a lower package version number.
→ found by ucs-tests 10_update_extension_via_package, 
  11_update_extension_via_package_expected_fail and 
  12_update_extension_via_other_packagename
→ REOPEN
Comment 8 Arvid Requate univentionstaff 2013-10-07 14:04:00 CEST
* ucs_registerLDAPExtension does not write UNIVENTION_APP_IDENTIFIER to LDAP.

The environment variable needs to be exported. I updated the API documentation for this.

* ucs_registerLDAPExtension does not write version start and version end to LDAP.

Ok, adjusted, this was only done for ldapacl extensions.

* ucs_registerLDAPExtension does not compare the package versions correctly.

Hmm, 11_update_extension_via_package_expected_fail works for me, is see the message:

  ERROR: Registered package version 7.8.6.6 is newer, refusing registration.

and the object is not updated.
Comment 9 Stefan Gohmann univentionstaff 2013-10-31 12:27:41 CET
The auto tests were passed.
Comment 10 Stefan Gohmann univentionstaff 2013-11-19 06:42:33 CET
UCS 3.2 has been released:
 http://docs.univention.de/release-notes-3.2-en.html
 http://docs.univention.de/release-notes-3.2-de.html

If this error occurs again, please use "Clone This Bug".