Commit a8f178a8 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

grid: fix distribution_tuple()

 * consider raspbian as a debian
 * never set id

After the change to distro.linux_distribution() in
425f5bb7, raspbian is correctly detected
and id is set, see the execution of both functions on raspbian:

>>> platform.linux_distribution('', '', '', platform._supported_dists, 1)
('debian', '10.11', '')

>>> distro.linux_distribution(full_distribution_name=False)
('raspbian', '10', 'buster')
parent 392a993b
Pipeline #20311 failed with stage
in 0 seconds
...@@ -57,4 +57,10 @@ def os_matches(os1, os2): ...@@ -57,4 +57,10 @@ def os_matches(os1, os2):
def distribution_tuple(): def distribution_tuple():
return distro.linux_distribution(full_distribution_name=False) distname = distro.id()
version = distro.version()
if distname == 'raspbian':
distname = 'debian'
# we return something compatible with older platform.linux_distribution()
# id (last field of the tuple) was always empty
return distname, version, ''
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment