Bug 42128 - univention-network-manager should use the official UMC API
univention-network-manager should use the official UMC API
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Network
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0
Assigned To: Florian Best
Philipp Hahn
:
: 45093 (view as bug list)
Depends on:
Blocks: 54664
  Show dependency treegraph
 
Reported: 2016-08-25 14:20 CEST by Florian Best
Modified: 2022-04-12 12:55 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Development Internal
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): Cleanup
Max CVSS v3 score:
best: Patch_Available+


Attachments
patch (1.96 KB, patch)
2016-08-25 14:20 CEST, Florian Best
Details | Diff
patch (1.90 KB, patch)
2017-07-28 13:35 CEST, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2016-08-25 14:20:15 CEST
Created attachment 7922 [details]
patch

It would be better to use the HTTP API of UMC instead of the command line tool "umc-command" which goes directly against the UMC-Server.
Attached is a patch which modifies univention-register-network-address to use the univention-lib function.
Comment 1 Florian Best univentionstaff 2017-07-28 13:35:10 CEST
Created attachment 9073 [details]
patch
Comment 2 Florian Best univentionstaff 2020-07-06 11:53:50 CEST
Applied the patch.
Use python 3 instead.
Added changelog entry.

univention-network-manager (12.0.0-3)
| Bug #42128: use univention.lib.umc instead of umc-command

changelog-5.0-0.xml
| Bug #42128: add changelog entry
Comment 3 Florian Best univentionstaff 2020-07-06 11:54:22 CEST
*** Bug 45093 has been marked as a duplicate of this bug. ***
Comment 4 Philipp Hahn univentionstaff 2020-07-15 17:45:17 CEST
OK: 1ae22f23afc2 | Bug #42128: use univention.lib.umc instead of umc-command
OK: d5c9cae5224a | Bug #42128: add changelog entry

OK: dpkg -L univention-network-common
OK: SYSTEMCTL_SKIP_REDIRECT=1 bash -x /etc/init.d/univention-network-common start
FIXED: /usr/sbin/univention-register-network-address --verbose --force --interface eth0

#backup# /usr/sbin/univention-register-network-address --interface eth0 --verbose --force
BadRequest: 400 on b35.phahn.dev (command/ip/change): {'status': 400, 'message': 'The IP address is already in used by host record(s) for: ucs-sso, gc._msdcs, DomainDnsZones, ForestDnsZones, b35', 'traceback': None, 'location': 'https://b35.phahn.dev/univention/command'}

#member# /usr/sbin/univention-register-network-address --interface eth0 --verbose --force
Forbidden: 403 on mem38.phahn.dev (command/ip/change): {'status': 403, 'message': 'Verboten', 'traceback': None, 'location': 'https://mem38.phahn.dev/univention/command'}

OK: b64a25577dfe781673c0aa03b099b6ed4489361d | fixup
OK: ae1e31b7e474a9df3009b5e14035ec53e4a98d11 | fixup
OK: univention-network-common 12.0.0-3A~5.0.0.202007151716

RANT: This script looks broken as it fails as soon as the host has any DNS entry, which are not updated and block the registration of the new address.
Comment 5 Florian Best univentionstaff 2021-05-25 16:03:28 CEST
UCS 5.0 has been released:
 https://docs.software-univention.de/release-notes-5.0-0-en.html
 https://docs.software-univention.de/release-notes-5.0-0-de.html

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