Make distro.id() report newer versions of OpenSuSE (at least >=15) also report as opensuse (#76121)

* Report OpenSuSE >= 15 as opensuse

Make distro.id() report newer versions of OpenSuSE (at least >=15) also report
as opensuse. They report themselves as opensuse-leap.

* Add a test
pull/78365/head
Ruediger Pluem 2 years ago committed by GitHub
parent eba15885cf
commit 0ef1376966
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,5 @@
bugfixes:
- >-
module_utils - Make distro.id() report newer versions of OpenSuSE
(at least >=15) also report as ``opensuse``. They report themselves as
``opensuse-leap``.

@ -87,6 +87,7 @@ _OS_RELEASE_BASENAME = "os-release"
#: * Value: Normalized value.
NORMALIZED_OS_ID = {
"ol": "oracle", # Oracle Linux
"opensuse-leap": "opensuse", # Newer versions of OpenSuSE report as opensuse-leap
}
#: Translation table for normalizing the "Distributor ID" attribute returned by

@ -31,3 +31,9 @@ class TestDistro():
def test_id(self):
id = distro.id()
assert isinstance(id, string_types), 'distro.id() returned %s (%s) which is not a string' % (id, type(id))
def test_opensuse_leap_id(self):
name = distro.name()
if name == 'openSUSE Leap':
id = distro.id()
assert id == 'opensuse', "OpenSUSE Leap did not return 'opensuse' as id"

Loading…
Cancel
Save