mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge branch '2019.2.1' into aix_docs
This commit is contained in:
commit
a59f45ebde
1 changed files with 15 additions and 2 deletions
|
@ -503,6 +503,11 @@ def get_system_info():
|
|||
'''
|
||||
Get system information.
|
||||
|
||||
.. note::
|
||||
|
||||
Not all system info is available across all versions of Windows. If it
|
||||
is not available on an older version, it will be skipped
|
||||
|
||||
Returns:
|
||||
dict: Dictionary containing information about the system to include
|
||||
name, description, version, etc...
|
||||
|
@ -573,6 +578,10 @@ def get_system_info():
|
|||
6: 'Appliance PC',
|
||||
7: 'Performance Server',
|
||||
8: 'Maximum'}
|
||||
# Must get chassis_sku_number this way for backwards compatibility
|
||||
# system.ChassisSKUNumber is only available on Windows 10/2016 and newer
|
||||
product = conn.Win32_ComputerSystemProduct()[0]
|
||||
ret.update({'chassis_sku_number': product.SKUNumber})
|
||||
system = conn.Win32_ComputerSystem()[0]
|
||||
# Get pc_system_type depending on Windows version
|
||||
if platform.release() in ['Vista', '7', '8']:
|
||||
|
@ -586,7 +595,6 @@ def get_system_info():
|
|||
'bootup_state': system.BootupState,
|
||||
'caption': system.Caption,
|
||||
'chassis_bootup_state': warning_states[system.ChassisBootupState],
|
||||
'chassis_sku_number': system.ChassisSKUNumber,
|
||||
'dns_hostname': system.DNSHostname,
|
||||
'domain': system.Domain,
|
||||
'domain_role': domain_role[system.DomainRole],
|
||||
|
@ -615,7 +623,12 @@ def get_system_info():
|
|||
ret['processors'] += 1
|
||||
ret['processors_logical'] += system.NumberOfLogicalProcessors
|
||||
ret['processor_cores'] += system.NumberOfCores
|
||||
ret['processor_cores_enabled'] += system.NumberOfEnabledCore
|
||||
try:
|
||||
ret['processor_cores_enabled'] += system.NumberOfEnabledCore
|
||||
except (AttributeError, TypeError):
|
||||
pass
|
||||
if ret['processor_cores_enabled'] == 0:
|
||||
ret.pop('processor_cores_enabled', False)
|
||||
|
||||
system = conn.Win32_BIOS()[0]
|
||||
ret.update({'hardware_serial': system.SerialNumber,
|
||||
|
|
Loading…
Add table
Reference in a new issue