Bug 50100 - Switch from call to check_call in doIt from our debhelper
Switch from call to check_call in doIt from our debhelper
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UCR
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 5.0
Assigned To: Florian Best
Sebastian Lobinger
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-09-03 10:48 CEST by Jürn Brodersen
Modified: 2021-05-25 15:59 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): API change
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jürn Brodersen univentionstaff 2019-09-03 10:48:35 CEST
Switch from "call" to "check_call" in doIt from our debhelper

The base/univention-config-registry/python/univention/debhelper.py:doIt function uses subprocess.call and returns the process return code. I would prefer using check_call since I think that might have caught bug 50098.

A quick grep shows that out of 55 calls to doIt, only 4 seem to check the return code.

Note: this might break a few builds
Comment 1 Philipp Hahn univentionstaff 2020-07-08 08:41:21 CEST
Implementation moved to packaging/univention-debhelper/univention/debhelper.py

This also would have fixed Bug #32658
Comment 2 Florian Best univentionstaff 2020-09-22 10:48:12 CEST
univention-management-console-module-adtakeover (6.0.1-11)
e9793ec6df98 | Bug #50100: remove unused UMC files

univention-management-console-module-lib (9.0.0-1)
e44faaa5ea60 | Bug #50100 UMC lib: do not reference not existing category definition

univention-config-registry (15.0.2-0)
dbb125d95544 | Bug #50100 UCR: use check_call for error handling in doIt()

univention-app-appliance (3.0.1-11)
e9793ec6df98 | Bug #50100: remove unused UMC files

changelog-5.0-0.xml
3c5b4e5f9143 | Changelog Bug #50100

univention-portal (3.0.2-8)
e9793ec6df98 | Bug #50100: remove unused UMC files

univention-debhelper (2.0.0-2)
dbb125d95544 | Bug #50100 UCR: use check_call for error handling in doIt()

univention-management-console (12.0.0-13)
7723f4329062 | Bug #50100: do not require UMC module definition for UMC core
Comment 3 Sebastian Lobinger univentionstaff 2021-03-10 15:33:38 CET
verified:
- doIt function now raises exception on non zero exit code
  python3 -c 'import univention.debhelper; univention.debhelper.doIt("/bin/false");'

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/univention/debhelper.py", line 56, in doIt
    return subprocess.check_call(argv)
  File "/usr/lib/python3.7/subprocess.py", line 347, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '('/bin/false',)' returned non-zero exit status 1.

It seems the change does not brake anything more then the packages Florian Best already has fixed, otherwise we should already have noticed because packages would not build.
Comment 4 Florian Best univentionstaff 2021-05-25 15:59:06 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".