mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Getting the 'os' grain from CPE_NAME inside /etc/os-release for SUSE and openSUSE
This commit is contained in:
parent
64af4d4145
commit
bc671336a7
1 changed files with 7 additions and 1 deletions
|
@ -1265,6 +1265,11 @@ def os_data():
|
|||
grains['lsb_distrib_release'] = os_release['VERSION_ID']
|
||||
if 'PRETTY_NAME' in os_release:
|
||||
grains['lsb_distrib_codename'] = os_release['PRETTY_NAME']
|
||||
if 'CPE_NAME' in os_release:
|
||||
if ":suse:" in os_release['CPE_NAME']:
|
||||
grains['os'] = "SUSE"
|
||||
elif ":opensuse:" in os_release['CPE_NAME']:
|
||||
grains['os'] = "SUSE"
|
||||
elif os.path.isfile('/etc/SuSE-release'):
|
||||
grains['lsb_distrib_id'] = 'SUSE'
|
||||
version = ''
|
||||
|
@ -1372,7 +1377,8 @@ def os_data():
|
|||
shortname = distroname.replace(' ', '').lower()[:10]
|
||||
# this maps the long names from the /etc/DISTRO-release files to the
|
||||
# traditional short names that Salt has used.
|
||||
grains['os'] = _OS_NAME_MAP.get(shortname, distroname)
|
||||
if 'os' not in grains:
|
||||
grains['os'] = _OS_NAME_MAP.get(shortname, distroname)
|
||||
grains.update(_linux_cpudata())
|
||||
grains.update(_linux_gpu_data())
|
||||
elif grains['kernel'] == 'SunOS':
|
||||
|
|
Loading…
Add table
Reference in a new issue