Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
systemsmanagement:saltstack:products:testing
py27-compat-salt
backport-of-https-github.com-saltstack-salt-pul...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File backport-of-https-github.com-saltstack-salt-pull-596.patch of Package py27-compat-salt
From dcaea75cd3a3f3f4eb6c56567132445ee54172a7 Mon Sep 17 00:00:00 2001 From: Pau Garcia Quiles <pau.garcia@suse.com> Date: Tue, 13 Apr 2021 10:31:29 +0200 Subject: [PATCH] Backport of https://github.com/saltstack/salt/pull/59687 (#350) --- salt/grains/core.py | 4 ++-- tests/unit/grains/test_core.py | 35 +++++++++++++++++++++------------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/salt/grains/core.py b/salt/grains/core.py index 4eb4fed9b5..9b3f51ef40 100644 --- a/salt/grains/core.py +++ b/salt/grains/core.py @@ -1468,7 +1468,7 @@ _OS_NAME_MAP = { 'slesexpand': 'RES', 'linuxmint': 'Mint', 'neon': 'KDE neon', - 'alibaba': 'Alibaba Cloud (Aliyun)', + 'alibabaclo': 'Alinux', } # Map the 'os' grain to the 'os_family' grain @@ -1543,7 +1543,7 @@ _OS_FAMILY_MAP = { 'AIX': 'AIX', 'TurnKey': 'Debian', 'AstraLinuxCE': 'Debian', - 'Alibaba Cloud (Aliyun)': 'RedHat', + 'Alinux': 'RedHat', } # Matches any possible format: diff --git a/tests/unit/grains/test_core.py b/tests/unit/grains/test_core.py index c7a9610828..5deb9543ed 100644 --- a/tests/unit/grains/test_core.py +++ b/tests/unit/grains/test_core.py @@ -650,22 +650,31 @@ class CoreGrainsTestCase(TestCase, LoaderModuleMockMixin): self._run_os_grains_tests("astralinuxce-2.12.22", _os_release_map, expectation) @skipIf(not salt.utils.platform.is_linux(), 'System is not Linux') - def test_aliyunlinux2_os_grains(self): - ''' - Test if OS grains are parsed correctly in Alibaba Cloud Linux (Aliyun Linux) 2.1903 LTS - ''' + def test_alinux2_os_grains(self): + """ + Test if OS grains are parsed correctly in Alibaba Cloud Linux + """ _os_release_map = { - 'linux_distribution': ('Alibaba Cloud Linux (Aliyun Linux)', '2.1903', 'Alibaba Cloud Linux (Aliyun Linux) 2.1903 LTS (Hunting Beagle)'), + "os_release_file": { + "NAME": "Alibaba Cloud Linux (Aliyun Linux)", + "VERSION": "2.1903 LTS (Hunting Beagle)", + "VERSION_ID": "2.1903", + "PRETTY_NAME": "Alibaba Cloud Linux (Aliyun Linux) 2.1903 LTS (Hunting Beagle)", + "ID": "alinux", + "ANSI_COLOR": "0;31", + }, + "_linux_distribution": ("alinux", "2.1903", "LTS"), } + expectation = { - 'os': 'Alibaba Cloud (Aliyun)', - 'os_family': 'RedHat', - 'oscodename': 'Alibaba Cloud Linux (Aliyun Linux) 2.1903 LTS (Hunting Beagle)', - 'osfullname': 'Alibaba Cloud Linux (Aliyun Linux)', - 'osrelease': '2.1903', - 'osrelease_info': (2, 1903), - 'osmajorrelease': 2, - 'osfinger': 'Alibaba Cloud Linux (Aliyun Linux)-2', + "os": "Alinux", + "os_family": "RedHat", + "oscodename": "Alibaba Cloud Linux (Aliyun Linux) 2.1903 LTS (Hunting Beagle)", + "osfullname": "Alibaba Cloud Linux (Aliyun Linux)", + "osrelease": "2.1903", + "osrelease_info": (2, 1903), + "osmajorrelease": 2, + "osfinger": "Alibaba Cloud Linux (Aliyun Linux)-2", } self._run_os_grains_tests(None, _os_release_map, expectation) -- 2.30.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor