From 77868a410400f538a6ce6c8c340667227a09a782 Mon Sep 17 00:00:00 2001 From: stephane Date: Wed, 14 Sep 2016 13:34:53 -0700 Subject: [PATCH] Set Suse family for openSUSE Tumbleweed & Leap On openSUSE Tumbleweed, lsb-release -a currently reports the distributor ID as "openSUSE Tumbleweed". On openSUSE Leap, the distributor ID is "SUSE LINUX". Add them to the OS_FAMILY dict as Suse family systems. Also add an entry to TESTSETS in test_distribution_version.py for openSUSE Tumbleweed. --- lib/ansible/module_utils/facts.py | 2 +- .../module_utils/test_distribution_version.py | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index 2c98d472b7..0a89ccd069 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -633,7 +633,7 @@ class Distribution(object): SLC = 'RedHat', Ascendos = 'RedHat', CloudLinux = 'RedHat', PSBM = 'RedHat', OracleLinux = 'RedHat', OVS = 'RedHat', OEL = 'RedHat', Amazon = 'RedHat', XenServer = 'RedHat', Ubuntu = 'Debian', Debian = 'Debian', Raspbian = 'Debian', Slackware = 'Slackware', SLES = 'Suse', - SLED = 'Suse', openSUSE = 'Suse', SuSE = 'Suse', SLES_SAP = 'Suse', Gentoo = 'Gentoo', Funtoo = 'Gentoo', + SLED = 'Suse', openSUSE = 'Suse', openSUSE_Tumbleweed = 'Suse', SuSE = 'Suse', SLES_SAP = 'Suse', SUSE_LINUX = 'Suse', Gentoo = 'Gentoo', Funtoo = 'Gentoo', 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', diff --git a/test/units/module_utils/test_distribution_version.py b/test/units/module_utils/test_distribution_version.py index 547a4d7e51..9bc8bf5d1a 100644 --- a/test/units/module_utils/test_distribution_version.py +++ b/test/units/module_utils/test_distribution_version.py @@ -172,6 +172,24 @@ ID_LIKE="suse" 'os_family': u'Suse', 'distribution_version': u'13.2'} }, + { + "platform.dist": [ + "", + "", + "" + ], + "input": { + "/etc/os-release": "NAME=\"openSUSE Tumbleweed\"\n# VERSION=\"20160917\"\nID=opensuse\nID_LIKE=\"suse\"\nVERSION_ID=\"20160917\"\nPRETTY_NAME=\"openSUSE Tumbleweed\"\nANSI_COLOR=\"0;32\"\nCPE_NAME=\"cpe:/o:opensuse:tumbleweed:20160917\"\nBUG_REPORT_URL=\"https://bugs.opensuse.org\"\nHOME_URL=\"https://www.opensuse.org/\"\n" + }, + "name": "openSUSE Tumbleweed 20160917", + "result": { + "distribution_release": "NA", + "distribution": "openSUSE Tumbleweed", + "distribution_major_version": "NA", + "os_family": "Suse", + "distribution_version": "20160917" + } + }, { # see https://github.com/ansible/ansible/issues/14837 "name": "SLES 11.3", "input": {