2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-27 19:37:44 +00:00

Merge "Support SYSTEM_PROD_DATA"

This commit is contained in:
Zuul 2019-04-04 21:28:47 +00:00 committed by Gerrit Code Review
commit cd14632ba6

View File

@ -278,8 +278,15 @@ class LenovoFirmwareConfig(object):
continue
cfglabel = config.find('mriName')
cfglabel = lenovo_id if cfglabel is None else cfglabel.text
for group in config.iter("group"):
lenovo_group = group.get("ID")
if lenovo_id == 'SYSTEM_PROD_DATA':
theiter = [config]
else:
theiter = config.iter('group')
for group in theiter:
if lenovo_id == 'SYSTEM_PROD_DATA':
lenovo_group = None
else:
lenovo_group = group.get("ID")
for setting in group.iter("setting"):
is_list = False
lenovo_setting = setting.get("ID")
@ -430,12 +437,14 @@ class LenovoFirmwareConfig(object):
changes = True
config = etree.Element('config', ID=options[option]['lenovo_id'])
configurations.append(config)
group = etree.Element('group', ID=options[option]['lenovo_group'])
config.append(group)
setting = etree.Element('setting',
ID=options[option]['lenovo_setting'])
group.append(setting)
if options[option]['lenovo_group'] is not None:
group = etree.Element('group', ID=options[option]['lenovo_group'])
config.append(group)
group.append(setting)
else:
config.append(setting)
if is_list:
container = etree.Element('list_data')
setting.append(container)