Univention Bugzilla – Bug 50974
not possible to deactivate default options with current API
Last modified: 2021-02-17 10:08:14 CET
Removing an entry of the "options" list of an object will not deactivate the option in UCS, if it is "on" by default. The shares/share option "nfs" is on by default. If an object is created with: ------------------------------------------------------------------ async with UDM(**udm_kwargs) as udm: mod = udm.get("shares/share") obj = await mod.new() obj.options = ["samba"] obj.props.name = "foo" obj.props.host = "file.example.com" obj.props.path = f"/home/shares/foo" await obj.save() ------------------------------------------------------------------ obj will then have: obj.options = ["samba", "nfs"] The UDM REST API expects an object: {"samba": true, "nfs": false} When only {"samba": true} is submitted, "nfs" will always be activated.
Fixed with: [master] cbb26c1 Bug #50974: API change: 'options' is dict now This is a *breaking* API change: the UDM objects 'options' attribute is now a dict. It was a list before. All checks passed, documentation is published: * https://travis-ci.com/univention/python-udm-rest-api-client/ * https://codecov.io/gh/univention/python-udm-rest-api-client/ * https://readthedocs.org/projects/udm-rest-client/builds/
PyPI: * https://test.pypi.org/project/udm-rest-client/0.5.0/ * https://pypi.org/project/udm-rest-client/0.5.0/
Installled udm rest client locally on my machine for testing. Openapi update ran against singleserver with default school installation. Options are correctly parsed: OK Options are now dicts: OK changing options and disabling default options works: OK Tests,CodeCov: OK PyPI: OK Docs: REOPEN Currently the only way to see that a breaking change was introduced in 0.5.0 is to check the history. Though this was only a minor version change and thus breaking changes are not to be expected. I would wish for some kind of documentation for the options in the actual doc (outside history) and maybe we should think about releasing v 1.0 at some point as the software is afaik in productive use.
I added a section on options with a visible notice about the API change: https://udm-rest-client.readthedocs.io/en/latest/usage.html#options The version was raised to 1.0.0 and packages published to PyPI. The Github actions are now fixed as well: https://github.com/univention/python-udm-rest-api-client/actions
OpenAPI generator 5.0.0 is now used and the JAR checksum is checked: [master 98e8caa] Bug #50974: version 1.0.1, update openapi-generator to 5.0.0, verify checksum
Version 1.0.1 is now used by the Kelvin API version 1.3.0.
Updated version is installed in Kelvin and works. Documentation, automated tests and CI works like a charm