Skip to content

Commit

Permalink
fixes #62496 add biosvendor grain
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasmhughes authored and Megan Wilhite committed Aug 22, 2022
1 parent d5dec79 commit fabd134
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog/62496.added
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add biosvendor grain
5 changes: 5 additions & 0 deletions salt/grains/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2716,6 +2716,7 @@ def _hw_data(osdata):
Provides
biosversion
biosvendor
productname
manufacturer
serialnumber
Expand All @@ -2734,6 +2735,7 @@ def _hw_data(osdata):
# requires CONFIG_DMIID to be enabled in the Linux kernel configuration
sysfs_firmware_info = {
"biosversion": "bios_version",
"biosvendor": "bios_vendor",
"productname": "product_name",
"manufacturer": "sys_vendor",
"biosreleasedate": "bios_date",
Expand Down Expand Up @@ -2773,6 +2775,7 @@ def _hw_data(osdata):
# smbios is also not compatible with linux's smbios (smbios -s = print summarized)
grains = {
"biosversion": __salt__["smbios.get"]("bios-version"),
"biosvendor": __salt__["smbios.get"]("bios-vendor"),
"productname": __salt__["smbios.get"]("system-product-name"),
"manufacturer": __salt__["smbios.get"]("system-manufacturer"),
"biosreleasedate": __salt__["smbios.get"]("bios-release-date"),
Expand Down Expand Up @@ -2811,6 +2814,7 @@ def _hw_data(osdata):
# In theory, it will be easier to add new fields to this later
fbsd_hwdata = {
"biosversion": "smbios.bios.version",
"biosvendor": "smbios.bios.vendor",
"manufacturer": "smbios.system.maker",
"serialnumber": "smbios.system.serial",
"productname": "smbios.system.product",
Expand All @@ -2837,6 +2841,7 @@ def _hw_data(osdata):
sysctl = salt.utils.path.which("sysctl")
nbsd_hwdata = {
"biosversion": "machdep.dmi.board-version",
"biosvendor": "machdep.dmi.bios-vendor",
"manufacturer": "machdep.dmi.system-vendor",
"serialnumber": "machdep.dmi.system-serial",
"productname": "machdep.dmi.system-product",
Expand Down
1 change: 1 addition & 0 deletions tests/pytests/unit/grains/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2646,6 +2646,7 @@ def test__hw_data_linux_empty():
assert core._hw_data({"kernel": "Linux"}) == {
"biosreleasedate": "",
"biosversion": "",
"biosvendor": "",
"manufacturer": "",
"productname": "",
"serialnumber": "",
Expand Down

0 comments on commit fabd134

Please sign in to comment.