ubuntu/centos/debian: get_linux_distro has different behavior than platform.dist

Bug #1780481 reported by Chad Smith
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
High
Chad Smith

Bug Description

Recently cloudinit added get_linux_distro to replace platform.dist() functionality.
The behavior returned a tuple on ubuntu that doens't match the platform.dist module.

python3 -c 'from platform import dist; from cloudinit.util import get_linux_distro; print(dist()); print(get_linux_distro())'
('Ubuntu', '16.04', 'xenial')
('ubuntu', '16.04', 'x86_64')

This breaks ntp configuration in cloud-init on xenial, which checks
(_name, _version, codename) = util.system_info()['dist']
if codename == "xenial" and not util.system_is_snappy():
...

Also CentOS 7 behavior:
[root@c71 ~]# python -c 'from platform import dist; from cloudinit.util import get_linux_distro; print(dist()); print(get_linux_distro())'
('centos', '7.5.1804', 'Core')
('centos', '7', 'x86_64')

Debian stretch:
root@debStretch:~# python -c 'from platform import dist; print(dist());'('debian', '9.4', '')

openSuse 42.3:
sles42:~ # python3 -c 'from platform import dist; print(dist());'
('SuSE', '42.3', 'x86_64')

Related branches

Chad Smith (chad.smith)
summary: - ubuntu/centos: get_linux_distro has differnet behavior than
+ ubuntu/centos/debian: get_linux_distro has different behavior than
platform.dist
Chad Smith (chad.smith)
Changed in cloud-init:
assignee: nobody → Chad Smith (chad.smith)
status: New → Triaged
importance: Undecided → High
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

This bug is fixed with commit c1a75a69 to cloud-init on branch master.
To view that commit see the following URL:
https://git.launchpad.net/cloud-init/commit/?id=c1a75a69

Changed in cloud-init:
status: Triaged → Fix Committed
Chad Smith (chad.smith)
tags: added: regression-proposed
tags: added: verification-needed verification-needed-artful verification-needed-bionic verification-needed-xenial
Revision history for this message
Scott Moser (smoser) wrote : Fixed in cloud-init version 18.4.

This bug is believed to be fixed in cloud-init in version 18.4. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.