From 4ff8890ec1fa4e0dfb7e1d4aebbedf6cd8d68621 Mon Sep 17 00:00:00 2001 From: Matt Robinson Date: Thu, 27 Oct 2016 19:22:08 +0100 Subject: [PATCH] Set ansible_os_family correctly under KDE neon As neon is derived from Ubuntu, ansible_os_family should have the value "Debian" instead of "Neon". Add a test case for KDE neon and set os_family correctly for it. --- lib/ansible/module_utils/facts.py | 2 +- .../module_utils/test_distribution_version.py | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index 5d8e02d62a5..d76668d3b89 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -648,7 +648,7 @@ class Distribution(object): Archlinux = 'Archlinux', Manjaro = 'Archlinux', Mandriva = 'Mandrake', Mandrake = 'Mandrake', Altlinux = 'Altlinux', Solaris = 'Solaris', Nexenta = 'Solaris', OmniOS = 'Solaris', OpenIndiana = 'Solaris', SmartOS = 'Solaris', AIX = 'AIX', Alpine = 'Alpine', MacOSX = 'Darwin', - FreeBSD = 'FreeBSD', HPUX = 'HP-UX', openSUSE_Leap = 'Suse' + FreeBSD = 'FreeBSD', HPUX = 'HP-UX', openSUSE_Leap = 'Suse', Neon = 'Debian' ) def __init__(self, module): diff --git a/test/units/module_utils/test_distribution_version.py b/test/units/module_utils/test_distribution_version.py index 9bc8bf5d1a1..584ac710c0c 100644 --- a/test/units/module_utils/test_distribution_version.py +++ b/test/units/module_utils/test_distribution_version.py @@ -402,6 +402,25 @@ VERSION_ID="12.04" "os_family": "Debian", 'distribution_version': u'12.04'} }, + { + "platform.dist": [ + "neon", + "16.04", + "xenial" + ], + "input": { + "/etc/os-release": "NAME=\"KDE neon\"\nVERSION=\"5.8\"\nID=neon\nID_LIKE=\"ubuntu debian\"\nPRETTY_NAME=\"KDE neon User Edition 5.8\"\nVERSION_ID=\"16.04\"\nHOME_URL=\"http://neon.kde.org/\"\nSUPPORT_URL=\"http://neon.kde.org/\"\nBUG_REPORT_URL=\"http://bugs.kde.org/\"\nVERSION_CODENAME=xenial\nUBUNTU_CODENAME=xenial\n", + "/etc/lsb-release": "DISTRIB_ID=neon\nDISTRIB_RELEASE=16.04\nDISTRIB_CODENAME=xenial\nDISTRIB_DESCRIPTION=\"KDE neon User Edition 5.8\"\n" + }, + "name": "KDE neon 16.04", + "result": { + "distribution_release": "xenial", + "distribution": "Neon", + "distribution_major_version": "16", + "os_family": "Debian", + "distribution_version": "16.04" + } + }, { 'name': 'Core OS', 'input': {