mirror of
https://github.com/inspec/inspec
synced 2024-12-03 09:59:26 +00:00
change from dmidecode to /sys/class/dmi/id/*
(kudos to Seife) Signed-off-by: Eike Waldt <waldt@b1-systems.de>
This commit is contained in:
parent
9fa97e8baa
commit
b47cf6e80e
2 changed files with 4 additions and 4 deletions
|
@ -33,7 +33,7 @@ module Inspec::Resources
|
|||
if os.darwin?
|
||||
"Apple Inc."
|
||||
elsif os.linux?
|
||||
inspec.command("dmidecode | grep 'Vendor :'").split(": ").last.chomp
|
||||
inspec.command("cat /sys/class/dmi/id/sys_vendor").stdout.chomp
|
||||
elsif os.windows?
|
||||
inspec.powershell("Get-CimInstance -ClassName Win32_ComputerSystem | Select Manufacturer -ExpandProperty Manufacturer").stdout.chomp
|
||||
else
|
||||
|
@ -47,7 +47,7 @@ module Inspec::Resources
|
|||
if os.darwin?
|
||||
inspec.command("system_profiler SPHardwareDataType | grep 'Model Identifier:'").split(": ").last.chomp
|
||||
elsif os.linux?
|
||||
inspec.command("dmidecode | grep 'Product Name: '").split(": ").last.chomp
|
||||
inspec.command("cat /sys/class/dmi/id/product_name").stdout.chomp
|
||||
elsif os.windows?
|
||||
inspec.powershell("Get-CimInstance -ClassName Win32_ComputerSystem | Select Model -ExpandProperty Model").stdout.chomp
|
||||
else
|
||||
|
|
|
@ -370,11 +370,11 @@ class MockLoader
|
|||
# hostname windows
|
||||
"$env:computername" => cmd.call("$env-computername"),
|
||||
# Manufacturer linux
|
||||
"dmidecode | grep 'Vendor: '" => cmd.call("manufacturer"),
|
||||
"cat /sys/class/dmi/id/sys_vendor" => cmd.call("manufacturer"),
|
||||
# Manufacturer windows
|
||||
"Get-CimInstance -ClassName Win32_ComputerSystem | Select Manufacturer -ExpandProperty Manufacturer" => cmd.call("manufacturer"),
|
||||
# Model linux
|
||||
"dmidecode | grep 'Product Name: '" => cmd.call("model"),
|
||||
"cat /sys/class/dmi/id/product_name" => cmd.call("model"),
|
||||
# Model windows
|
||||
"Get-CimInstance -ClassName Win32_ComputerSystem | Select Model -ExpandProperty Model" => cmd.call("model"),
|
||||
# windows_hotfix windows
|
||||
|
|
Loading…
Reference in a new issue