Merge ~jocave/plainbox-provider-resource:use-distro-if-available into plainbox-provider-resource:master
Proposed by
Jonathan Cave
Status: | Merged |
---|---|
Approved by: | Jonathan Cave |
Approved revision: | fbea1adb59d95fc47728528c13c3015af1ab8be5 |
Merged at revision: | 117df7482093b66a45c31062d33775d4babaa457 |
Proposed branch: | ~jocave/plainbox-provider-resource:use-distro-if-available |
Merge into: | plainbox-provider-resource:master |
Diff against target: |
84 lines (+34/-22) 1 file modified
bin/lsb_resource.py (+34/-22) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Sylvain Pineau (community) | Approve | ||
Review via email: mp+397243@code.launchpad.net |
Description of the change
Use pytho3-distro when available to make the output of the lsb resource more useful. The crux of the change is that /etc/os-release is used over /etc/lsb-release.
Some example outputs, UC20:
distributor_id: Ubuntu Core
description: Ubuntu Core 20
release: 20
codename: unknown
20.10 desktop:
distributor_id: Ubuntu
description: Ubuntu 20.10
release: 20.10
codename: groovy
20.04 server:
distributor_id: Ubuntu
description: Ubuntu 20.04.1 LTS
release: 20.04
codename: focal
To post a comment you must log in.
Using distro module will imply having to deal with this bug: https:/ /github. com/nir0s/ distro/ issues/ 260
There's a patch in checkbox-core-snap:
https:/ /git.launchpad. net/checkbox- core-snap/ commit/ snap/snapcraft. yaml?id= 57f5af0255ac19c 8c447ebd01be756 138c6e4d37
Not sure if we will face it on deb checkbox but it could be a good idea to catch subprocess. CalledProcessEr ror in the resource code and fallback to the old code.