mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Just skip the smbios stuff on SmartOS regardless, even if smbios works
in the global zone, it is not compatible! Usage: smbios [-BeOsx] [-i id] [-t type] [-w file] [file] -B disable header validation for broken BIOSes -e display SMBIOS entry point information -i display only the specified structure -O display obsolete structure types -s display only a summary of structure identifiers and types -t display only the specified structure type -w write the raw data to the specified file -x display raw data for structures
This commit is contained in:
parent
ccd400a2f6
commit
749cc419ec
@ -1668,24 +1668,25 @@ def _hw_data(osdata):
|
||||
return {}
|
||||
|
||||
grains = {}
|
||||
if salt.utils.which_bin(['dmidecode', 'smbios']) is not None:
|
||||
if not salt.utils.is_smartos() or salt.utils.is_smartos_globalzone():
|
||||
grains = {
|
||||
'biosversion': __salt__['smbios.get']('bios-version'),
|
||||
'productname': __salt__['smbios.get']('system-product-name'),
|
||||
'manufacturer': __salt__['smbios.get']('system-manufacturer'),
|
||||
'biosreleasedate': __salt__['smbios.get']('bios-release-date'),
|
||||
'uuid': __salt__['smbios.get']('system-uuid')
|
||||
}
|
||||
grains = dict([(key, val) for key, val in grains.items() if val is not None])
|
||||
uuid = __salt__['smbios.get']('system-uuid')
|
||||
if uuid is not None:
|
||||
grains['uuid'] = uuid.lower()
|
||||
for serial in ('system-serial-number', 'chassis-serial-number', 'baseboard-serial-number'):
|
||||
serial = __salt__['smbios.get'](serial)
|
||||
if serial is not None:
|
||||
grains['serial'] = serial
|
||||
break
|
||||
# On SmartOS (possibly SunOS also) smbios only works in the global zone
|
||||
# smbios is also not compatible with linux's smbios (smbios -s = print summarized)
|
||||
if salt.utils.which_bin(['dmidecode', 'smbios']) is not None and not salt.utils.is_smartos():
|
||||
grains = {
|
||||
'biosversion': __salt__['smbios.get']('bios-version'),
|
||||
'productname': __salt__['smbios.get']('system-product-name'),
|
||||
'manufacturer': __salt__['smbios.get']('system-manufacturer'),
|
||||
'biosreleasedate': __salt__['smbios.get']('bios-release-date'),
|
||||
'uuid': __salt__['smbios.get']('system-uuid')
|
||||
}
|
||||
grains = dict([(key, val) for key, val in grains.items() if val is not None])
|
||||
uuid = __salt__['smbios.get']('system-uuid')
|
||||
if uuid is not None:
|
||||
grains['uuid'] = uuid.lower()
|
||||
for serial in ('system-serial-number', 'chassis-serial-number', 'baseboard-serial-number'):
|
||||
serial = __salt__['smbios.get'](serial)
|
||||
if serial is not None:
|
||||
grains['serial'] = serial
|
||||
break
|
||||
elif osdata['kernel'] == 'FreeBSD':
|
||||
# On FreeBSD /bin/kenv (already in base system)
|
||||
# can be used instead of dmidecode
|
||||
|
Loading…
Reference in New Issue
Block a user