Bug 50010 - ucr commit /config/file should print a warning if there is no template installed/registered for that file
ucr commit /config/file should print a warning if there is no template instal...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UCR
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 5.0-0-errata
Assigned To: Nikola Radovanovic
Arvid Requate
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-08-14 16:39 CEST by Nico Stöckigt
Modified: 2021-12-08 17:17 CET (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.091
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2019080821000334
Bug group (optional): bitesize
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nico Stöckigt univentionstaff 2019-08-14 16:39:26 CEST
If there is no template for the destination file registered, 'ucr commit' should print a warning about that.
Of course it would be ideal if it also points to the related package.
Comment 1 Arvid Requate univentionstaff 2019-08-19 14:25:41 CEST
Ok, you can see this when the file is not written:

root@master10:~# ucr commit /etc/samba/unregistered.file
root@master10:~# ucr commit /etc/samba/smb.conf 
Multifile: /etc/samba/smb.conf
Comment 3 Nikola Radovanovic univentionstaff 2021-11-02 14:24:15 CET
f046e4211b | 0010 - ucr commit /config/file prints a warning if there is no template
7b375418d0 | 0010: Advisory update
Comment 4 Nikola Radovanovic univentionstaff 2021-11-08 17:51:10 CET
While running:
  ucr commit

There is an error showing that not all pending_handlers have to_file attribute.

New MR: https://git.knut.univention.de/univention/ucs/-/merge_requests/161
Comment 5 Nikola Radovanovic univentionstaff 2021-11-09 08:13:46 CET
Here is the original stack trace:

Traceback (most recent call last):
  File "/usr/sbin/ucr", line 67, in <module>
    sys.exit(ub.main(convertToUtf8(sys.argv[1:])))
  File "/usr/lib/python3/dist-packages/univention/config_registry/frontend.py", line 828, in main
    result = handler_func(args, cmd_opts)
  File "/usr/lib/python3/dist-packages/univention/config_registry/frontend.py", line 310, in handler_commit
    handlers.commit(ucr, args)
  File "/usr/lib/python3/dist-packages/univention/config_registry/handler.py", line 1141, in commit
    for fname in set(_filelist).difference(set(h.to_file for h in pending_handlers)):
  File "/usr/lib/python3/dist-packages/univention/config_registry/handler.py", line 1141, in <genexpr>
    for fname in set(_filelist).difference(set(h.to_file for h in pending_handlers)):
AttributeError: 'ConfigHandlerModule' object has no attribute 'to_file'
Comment 6 Nikola Radovanovic univentionstaff 2021-11-10 09:27:41 CET
7b375418d0 | Advisory update
8d22ed1a24 | ucr commit /config/file prints a warning if there is no template
abf81b2177 | Advisory update
Comment 7 Arvid Requate univentionstaff 2021-12-06 17:27:15 CET
Verified:
* Code review
* Package update
* Functional test
* Advisory
Comment 8 Arvid Requate univentionstaff 2021-12-06 17:33:03 CET
b3e65c1168 | Advisory line length