Univention Bugzilla – Bug 37725
/etc/lsb-release: Double quotes making python report '"Univention"' as distname
Last modified: 2015-08-20 13:16:15 CEST
Steps to reproduce: python >>>import platform >>>print platform.dist()[0] Expected result: Univention Actual result: "Univention" Suggested fix: /etc/lsb-release:11 DISTRIB_ID="Univention" ==> DISTRIB_ID=Univention
Created attachment 6674 [details] Fix LSB configuration This also broke during my CEPH testing.
*** Bug 39023 has been marked as a duplicate of this bug. ***
Fixed in 62938.
YAML is in r62940.
OK: r62938 r62940 OK: DEBIAN_FRONTEND=noninteractive aptitude install -y '?source-package(univention-base-files)~i' OK: cat /etc/lsb-release OK: lsb_release -s -i # Univention OK: lsb_release -s -r # 4.0-3 errata285 OK: lsb_release -s -c # Walle OK: lsb_release -s -d # Univention Corporate Server 4.0-3 errata285 (Walle) OK: python -c 'import platform;print platform.dist()' # ('Univention', '4.0-3 errata285', 'Walle') OK: 2015-08-11-univention-base-files.yaml OK: errata-announce -V FAIL: /usr/share/doc/lsb-release/README.Debian > The file should be formatted as a series of shell variable > assignments. Multiword strings should be quoted in double quotes. We don't know what else parses the file. Quotes can be removed for - DISTRIB_ID always, as "Univention" is a single word. - DISTRIB_RELEASE if "X.Y-Z+E" would be used instead of "X.Y-Z errataE" - DISTRIB_CODENAME if we never use a two-word codename like "{mountain/copper/golden} beach" again. (or change blanks to under-scores) DISTRIB_DESCRIPTION should stay quoted. Looks like /usr/lib/python2.7/platform.py needs to handle the un-quoting, but the format of "/etc/lsb-release" is not specified by LSB itself - only "lsb_release" is. FYI: Please note that ID=Univention is hard-coded in /usr/bin/lsb_release! FYI: /usr/share/pyshared/lsb_release.py:346 removes the quotes FYI: platform.dist() is deprecated: <https://bugs.python.org/issue1322> See <https://bugs.python.org/issue1322#msg73652> for a list of possibles values from other distributions.
Oh wow - platform.dist is a mess… lsb_release isn't really portable across distros, works for UCS though. BTW: I saw, that /etc/os-release contains original Debian information. If UCS were to switch to systemd (jessie?) it'd have to be adapted. > FAIL: /usr/share/doc/lsb-release/README.Debian > > The file should be formatted as a series of shell variable > > assignments. Multiword strings should be quoted in double quotes. Fixed in 62968, YAML in 62969.
OK: r62968 r62969 OK: DEBIAN_FRONTEND=noninteractive aptitude install -y '?source-package(univention-base-files)~i' OK: cat /etc/lsb-release OK: lsb_release -a OK: python -c 'import platform;print platform.dist()' # ('Univention', '"4.0-3 errata285"', 'Walle') FYI: RELEASE is still quoted - lets wait who parses it and fails OK: ucr set version/releasename='Walle Walle';lsb_release -s -c OK: errata-announce -V
<http://errata.univention.de/ucs/4.0/286.html>