From e813f3a435038499ddf3dcbcac7586854df4e1d6 Mon Sep 17 00:00:00 2001 From: Rares POP Date: Mon, 4 Jun 2018 15:07:56 +0300 Subject: [PATCH] Fix NI Linux RT distribution core grains NI fixed lsb_distrib_id to correctly differentiate between older distribution vs current distribution which have different behavior for multiple module functionality, but it should continue to populate 'osfullname' as 'NILinuxRT' not to break existing code Signed-off-by: Rares POP --- salt/grains/core.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/salt/grains/core.py b/salt/grains/core.py index da4219620e..7011af6fa9 100644 --- a/salt/grains/core.py +++ b/salt/grains/core.py @@ -1350,7 +1350,6 @@ _OS_NAME_MAP = { 'scientific': 'ScientificLinux', 'synology': 'Synology', 'nilrt': 'NILinuxRT', - 'nilrt-xfce': 'NILinuxRT-XFCE', 'poky': 'Poky', 'manjaro': 'Manjaro', 'manjarolin': 'Manjaro', @@ -1423,7 +1422,6 @@ _OS_FAMILY_MAP = { 'Cumulus': 'Debian', 'Deepin': 'Debian', 'NILinuxRT': 'NILinuxRT', - 'NILinuxRT-XFCE': 'NILinuxRT', 'KDE neon': 'Debian', 'Void': 'Void', 'IDMS': 'Debian', @@ -1788,8 +1786,11 @@ def os_data(): # so that linux_distribution() does the /etc/lsb-release parsing, but # we do it anyway here for the sake for full portability. if 'osfullname' not in grains: - grains['osfullname'] = \ - grains.get('lsb_distrib_id', osname).strip() + # If NI Linux RT distribution, set the grains['osfullname'] to 'nilrt' + if grains.get('lsb_distrib_id', '').lower().startswith('nilrt'): + grains['osfullname'] = 'nilrt' + else: + grains['osfullname'] = grains.get('lsb_distrib_id', osname).strip() if 'osrelease' not in grains: # NOTE: This is a workaround for CentOS 7 os-release bug # https://bugs.centos.org/view.php?id=8359