2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-15 04:07:48 +00:00

Show hidden settings

Change-Id: Ibe6673eb3ee2295712dfb0d1fc3d5b784d63e0db
This commit is contained in:
Jarrod Johnson 2018-08-03 20:13:22 -04:00
parent f04f2fd416
commit a694f5f314
4 changed files with 12 additions and 8 deletions

View File

@ -723,9 +723,9 @@ class Command(object):
else:
raise Exception("Unrecognized data format " + repr(fetchdata))
def get_system_configuration(self):
def get_system_configuration(self, hideadvanced=True):
self.oem_init()
return self._oem.get_system_configuration()
return self._oem.get_system_configuration(hideadvanced)
def set_system_configuration(self, changeset):
self.oem_init()

View File

@ -305,11 +305,14 @@ class OEMHandler(object):
"""
return False
def get_system_configuration(self):
def get_system_configuration(self, hideadvanced):
"""Retrieve system configuration
This returns a dictionary of settings names to dictionaries including
'current', 'default' and 'possible' values as well as 'help'
:param hideadvanced: Whether to hide 'advanced' settings that most
users should not need. Defaults to True.
"""
return {}

View File

@ -914,10 +914,10 @@ class OEMHandler(generic.OEMHandler):
progress=progress,
bank=bank)
def get_system_configuration(self):
def get_system_configuration(self, hideadvanced):
if self.has_imm or self.has_xcc:
return self.immhandler.get_system_configuration()
return super(OEMHandler, self).get_system_configuration()
return self.immhandler.get_system_configuration(hideadvanced)
return super(OEMHandler, self).get_system_configuration(hideadvanced)
def set_system_configuration(self, changeset):
if self.has_imm or self.has_xcc:

View File

@ -148,14 +148,15 @@ class IMMClient(object):
return None
return cls._parse_builddate(propstr)
def get_system_configuration(self):
def get_system_configuration(self, hideadvanced=True):
if not self.fwc:
self.fwc = config.LenovoFirmwareConfig(self.ipmicmd)
self.fwo = self.fwc.get_fw_options()
self.fwovintage = util._monotonic_time()
retcfg = {}
for opt in self.fwo:
if self.fwo[opt]['lenovo_protect'] or self.fwo[opt]['hidden']:
if (hideadvanced and self.fwo[opt]['lenovo_protect'] or
self.fwo[opt]['hidden']):
# Do not enumerate hidden settings
continue
retcfg[opt] = {}