set ansible_os_family from name variable in os-release for clearlinux… (#49906)

* set ansible_os_family from name variable in os-release for clearlinux OS (#49639)

* set ansible_os_family from name variable in os-release for clearlinux system

Signed-off-by: Josue David Hernandez Gutierrez <josue.d.hernandez.gutierrez@intel.com>

* Add os_family for clear linux and clear linux mixes

Signed-off-by: Josue David Hernandez Gutierrez <josue.d.hernandez.gutierrez@intel.com>
(cherry picked from commit 9202ef60b0)

* Adding Changelog fragment

Signed-off-by: Josue David Hernandez Gutierrez <josue.d.hernandez.gutierrez@intel.com>
This commit is contained in:
Josue David Hernandez 2019-01-09 16:32:06 -06:00 committed by Toshio Kuratomi
parent 99772e6ac3
commit e68541fa88
3 changed files with 8 additions and 2 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- set ansible_os_family from name variable in os-release

View file

@ -386,6 +386,9 @@ class DistributionFiles:
release = re.search('ID=(.*)', data) release = re.search('ID=(.*)', data)
if release: if release:
clear_facts['distribution_release'] = release.groups()[0] clear_facts['distribution_release'] = release.groups()[0]
pname = re.search('NAME="(.*)"', data)
if pname:
clear_facts['distribution'] = pname.groups()[0]
return True, clear_facts return True, clear_facts
@ -450,7 +453,8 @@ class Distribution(object):
'AIX': ['AIX'], 'AIX': ['AIX'],
'HP-UX': ['HPUX'], 'HP-UX': ['HPUX'],
'Darwin': ['MacOSX'], 'Darwin': ['MacOSX'],
'FreeBSD': ['FreeBSD', 'TrueOS']} 'FreeBSD': ['FreeBSD', 'TrueOS'],
'ClearLinux': ['Clear Linux OS', 'Clear Linux Mix']}
OS_FAMILY = {} OS_FAMILY = {}
for family, names in OS_FAMILY_MAP.items(): for family, names in OS_FAMILY_MAP.items():

View file

@ -949,7 +949,7 @@ PRIVACY_POLICY_URL="http://www.intel.com/privacy"
"name": "ClearLinux 26580", "name": "ClearLinux 26580",
"result": { "result": {
"distribution_release": "clear-linux-os", "distribution_release": "clear-linux-os",
"distribution": "ClearLinux", "distribution": "Clear Linux OS",
"distribution_major_version": "26580", "distribution_major_version": "26580",
"os_family": "ClearLinux", "os_family": "ClearLinux",
"distribution_version": "26580" "distribution_version": "26580"