Univention Bugzilla – Bug 47913
Provide UCR variables for setting log level in univention-updater
Last modified: 2019-01-04 14:09:11 CET
The updater code contains a lot of debug messages[1] that can never reach the updater.log as the `/usr/share/univention-updater/univention-updater` script only calls `ud.init(…)` but not `ud.set_level(…)`. It sure would be nice to be able to control the debug level via UCR variables like it's possible for other tools (e.g. the connectors) in order to debug problems. See this issue[2] for example. [1] /usr/share/pyshared/univention/updater/tools.py [2] https://help.univention.com/t/ucs-master-lauft-voll-und-kein-upgrade-moglich/9614/16
Successful build Package: univention-updater Version: 13.0.1-65A~4.3.0.201812131650 Branch: ucs_4.3-0 Scope: errata4.3-3 We are now able to set the debug level of univention-updater through ucr set update/debug/level
[4.3-3] 0a490b44c5 Bug #47913: univention-updater 13.0.1-65A~4.3.0.201812131650--- doc/errata/staging/univention-updater.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/errata/staging/univention-updater.yaml b/doc/errata/staging/univention-updater.yaml index 6ee0c5a2fa..7b5b62a4a9 100644 --- a/doc/errata/staging/univention-updater.yaml +++ b/doc/errata/staging/univention-updater.yaml @@ -5,6 +5,7 @@ scope: ucs_4.3-0-errata4.3-3 src: univention-updater fix: 13.0.1-65A~4.3.0.201812131650 desc: | This update addresses the following [-issue(s):-]{+issue:+} * Added [-an UMC-Variable-]{+the UCR variable `update/debug/level`+} for changing the debug level of [-univention-updater-]{+the UCS updater.+} bug: [47913]
I get univention-upgrade --ignoressh --ignoreterm Starting univention-upgrade. Current UCS version is 4.3-3 errata376 Checking for local repository: none Checking for package updates: none Checking for app updates: none Checking for release updates: found: UCS 4.4-0 Do you want to update to 4.4-0 [Y|n]? Y Starting update to UCS version 4.4-0 HINT: Please check the release notes carefully BEFORE updating to UCS 4.4-0: English version: https://docs.software-univention.de/release-notes-4.4-0-en.html German version: https://docs.software-univention.de/release-notes-4.4-0-de.html Please also consider documents of following release updates and 3rd party components. Do you want to continue [Y/n]? Y Checking for space on /var/cache/apt/archives: OK Checking for space on /boot: OK Checking for space on /: OK Checking for package status: OK Checking LDAP schema: OK Starting update process, this may take a while. Check /var/log/univention/updater.log for more information. Running postup.sh script:done. Traceback (most recent call last): File "/usr/share/univention-updater/univention-updater", line 610, in <module> main() File "/usr/share/univention-updater/univention-updater", line 351, in main ud.set_level(ud.NETWORK, loglevel) TypeError: an integer is required ERROR: update failed. Please check /var/log/univention/updater.log during the update. loglevel should be int!
dbdff0b288 Bug #47913: Advisory 5af8952a6f Bug #47913: Code cleanup and version bump Successful build Package: univention-updater Version: 13.0.1-66A~4.3.0.201812170955 Branch: ucs_4.3-0 Scope: errata4.3-3 User: jbremer fixed
git:157cbc6e610db48847894c88d37b32c08e8a7c24 breaks every Updater test: >(2018-12-18 00:51:02.145090) Traceback (most recent call last): >(2018-12-18 00:51:02.145150) File "/usr/share/univention-updater/univention-updater", line 610, in <module> >(2018-12-18 00:51:02.145221) main() >(2018-12-18 00:51:02.145245) File "/usr/share/univention-updater/univention-updater", line 388, in main >(2018-12-18 00:51:02.145264) baseConfig = ucr.ConfigRegistry() >(2018-12-18 00:51:02.145315) AttributeError: 'ConfigRegistry' object has no attribute 'ConfigRegistry' From python/univention-updater > 48 from univention.config_registry import ConfigRegistry ... > 55 import univention.config_registry as ucr ... > 79 ucr = ConfigRegistry()
(In reply to Philipp Hahn from comment #5) > git:157cbc6e610db48847894c88d37b32c08e8a7c24 breaks every Updater test: > >(2018-12-18 00:51:02.145090) Traceback (most recent call last): > >(2018-12-18 00:51:02.145150) File "/usr/share/univention-updater/univention-updater", line 610, in <module> > >(2018-12-18 00:51:02.145221) main() > >(2018-12-18 00:51:02.145245) File "/usr/share/univention-updater/univention-updater", line 388, in main > >(2018-12-18 00:51:02.145264) baseConfig = ucr.ConfigRegistry() > >(2018-12-18 00:51:02.145315) AttributeError: 'ConfigRegistry' object has no attribute 'ConfigRegistry' > > From python/univention-updater > > 48 from univention.config_registry import ConfigRegistry > ... > > 55 import univention.config_registry as ucr > ... > > 79 ucr = ConfigRegistry() ... > 388 baseConfig = ucr.ConfigRegistry( Move that last line before line 250, remove line 55 and use `baseConfig` in 350: > - 350 loglevel = ucr.get('update/debug/level', 2) > + 350 loglevel = baseConf.get('update/debug/level', 2) If you want to clean up the code rename the "baseConf" to "ucr" to get rid of that historic name. PS: Have a look at "flake8" and/or "mypy" which would flag line 79 as > redefinition of unused 'ucr' from line 55 [F811] [python/flake8]
Ok, you Felix fixed it in 4.3-3 and I fixed it in 4.4-0 and then Felix improved my fix.
<http://errata.software-univention.de/ucs/4.3/387.html>