summaryrefslogtreecommitdiff
path: root/ironic/db/sqlalchemy/api.py
diff options
context:
space:
mode:
authorBob Fournier <bfournie@redhat.com>2021-04-16 15:15:53 -0400
committerBob Fournier <bfournie@redhat.com>2021-05-27 12:15:20 -0400
commite15440370cca1f1a998d3607910697c3129d040a (patch)
tree679da9689641befecc922a83f2c4542999807825 /ironic/db/sqlalchemy/api.py
parentcaa4c8fd2964cd0c75025705497b7040c973dbe0 (diff)
downloadironic-e15440370cca1f1a998d3607910697c3129d040a.tar.gz
Include bios registry fields in bios API
Provide the fields in the BIOS setting API - ``/v1/nodes/{node}/bios/{setting}``, and in the BIOS setting list API when details are requested - ``/v1/nodes/<node>/bios?detail=True``. Story: #2008571 Task: #42483 Change-Id: Ie86ec57e428e2bb2efd099a839105e51a94824ab
Diffstat (limited to 'ironic/db/sqlalchemy/api.py')
-rw-r--r--ironic/db/sqlalchemy/api.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/ironic/db/sqlalchemy/api.py b/ironic/db/sqlalchemy/api.py
index 702755e97..6f027c96a 100644
--- a/ironic/db/sqlalchemy/api.py
+++ b/ironic/db/sqlalchemy/api.py
@@ -1675,6 +1675,15 @@ class Connection(api.Connection):
node_id=node_id,
name=setting['name'],
value=setting['value'],
+ attribute_type=setting.get('attribute_type'),
+ allowable_values=setting.get('allowable_values'),
+ lower_bound=setting.get('lower_bound'),
+ max_length=setting.get('max_length'),
+ min_length=setting.get('min_length'),
+ read_only=setting.get('read_only'),
+ reset_required=setting.get('reset_required'),
+ unique=setting.get('unique'),
+ upper_bound=setting.get('upper_bound'),
version=version)
bios_settings.append(bios_setting)
session.add(bios_setting)
@@ -1695,6 +1704,18 @@ class Connection(api.Connection):
node_id=node_id, name=setting['name'])
ref = query.one()
ref.update({'value': setting['value'],
+ 'attribute_type':
+ setting.get('attribute_type'),
+ 'allowable_values':
+ setting.get('allowable_values'),
+ 'lower_bound': setting.get('lower_bound'),
+ 'max_length': setting.get('max_length'),
+ 'min_length': setting.get('min_length'),
+ 'read_only': setting.get('read_only'),
+ 'reset_required':
+ setting.get('reset_required'),
+ 'unique': setting.get('unique'),
+ 'upper_bound': setting.get('upper_bound'),
'version': version})
bios_settings.append(ref)
session.flush()