Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hwbench: generic vendor: make monitoring file optional #67

Merged
merged 1 commit into from
Feb 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions hwbench/environment/vendors/generic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .vendor import BMC, Vendor
from .mock import MockedBMC
from .vendor import Vendor


class GenericVendor(Vendor):
Expand All @@ -9,11 +10,16 @@ def __init__(
monitoring_config_filename,
):
super().__init__(out_dir, dmi, monitoring_config_filename)
self.bmc = BMC(self.out_dir, self)

def detect(self) -> bool:
return True

def prepare(self):
if self.get_monitoring_config_filename():
super().prepare()
else:
self.bmc = MockedBMC(self.out_dir, self)

def save_bios_config(self):
print("Warning: using Generic BIOS vendor")
# TODO: in the future, dump available BIOS config via redfish
Expand All @@ -28,3 +34,8 @@ def save_bmc_config(self):

def name(self) -> str:
return "GenericVendor"

def find_monitoring_sections(self, section_type: str, sections_list=[], max_sections=0):
if self.get_monitoring_config_filename():
return super().find_monitoring_sections(section_type, sections_list, max_sections)
return []