Open Bug 1311580 Opened 4 years ago Updated 2 years ago
Fix mozinfo os
_version / linux _distro on Linux
58 bytes, text/x-review-board-request
Currently the Linux implementation of os_version / linux_distro in mozinfo uses `platform.linux_distribution()` which gives bogus results on Ubuntu: $ ./mach python Python 2.7.11 (default, Mar 4 2016, 09:31:38) [GCC 4.8.4] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mozinfo >>> mozinfo.os_version StringVersion ('jessie/sid') It seems to just be reading /etc/debian_version. I have a patch to read /etc/lsb-release and pull out the useful bits from there instead: $ ./mach python Python 2.7.11 (default, Mar 4 2016, 09:31:38) [GCC 4.8.4] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mozinfo >>> mozinfo.os_version StringVersion ('14.04') >>> mozinfo.linux_distro 'Ubuntu' I haven't tested it on non-Ubuntu yet, but I'm pretty sure that /etc/lsb-release works reliably.
...I was wrong and /etc/lsb-release is not portable, but /etc/os-release apparently is. This works on my local Ubuntu: $ PYTHONPATH=testing/mozbase/mozinfo/ python -mmozinfo.mozinfo has_sandbox: True linux_distro: Ubuntu bits: 64 os_version: 14.04 version: 14.04 os: linux processor: x86_64 and on Fedora 24: $ docker run --rm -t -i -v /build:/build -e PYTHONPATH=/build/mozilla-central/testing/mozbase/mozinfo/ fedora-24-python python -mmozinfo.mozinfo has_sandbox: True linux_distro: Fedora bits: 64 os_version: 24 version: 24 os: linux processor: x86_64
Comment on attachment 8802774 [details] bug 1311580 - Fix mozinfo os_version / linux_distro on Linux. https://reviewboard.mozilla.org/r/87072/#review86214 looks good Ted!
Attachment #8802774 - Flags: review?(jmaher) → review+
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/361ac37d15d6 Fix mozinfo os_version / linux_distro on Linux. r=jmaher
Backout by email@example.com: https://hg.mozilla.org/integration/autoland/rev/273cfb79666c Backed out changeset 361ac37d15d6 for breaking WPT's rather narrow expectations
e.g. https://treeherder.mozilla.org/logviewer.html#?job_id=5509474&repo=autoland - not sure if it actually puts what it thinks os and version are into the log, but the buildbot runs began being surprised by timeouts that they should have expected from the manifests.
You need to log in before you can comment on or make changes to this bug.