bugfix: Ensure kernel_package param is not required

A previous patchset introduced a new kernel
param option 'kernel_package.' This patch corrects
the logic in that so that the parameter is not a
required parameter - and if absent falls back to
the traditional MaaS behavior which will select the
latest kernel from the appropriate line.

Change-Id: Icc62b27e0f39914fb73fb9f655d9b7b0b6c6f489
This commit is contained in:
Alan Meadows 2018-10-19 07:56:18 -07:00
parent cdfb1737da
commit 037bde9934
1 changed files with 6 additions and 5 deletions

View File

@ -1,12 +1,15 @@
--- preseed.py 2018-10-15 12:52:41.611027184 -0700
+++ preseed2.py 2018-10-16 13:42:51.824755746 -0700
@@ -317,7 +317,23 @@
+++ preseed2.py 2018-10-19 07:26:10.985282758 -0700
@@ -317,7 +317,25 @@
The BootResourceFile table contains a mapping between hwe kernels and
Ubuntu package names. If this mapping is missing we fall back to letting
Curtin figure out which kernel should be installed"""
- kpackage = BootResource.objects.get_kpackage_for_node(node)
+
+ # previous logic to retrieve kpackage parameter
kpackage = BootResource.objects.get_kpackage_for_node(node)
+
+ # determine if this node has kernel parameters applied by drydock
+ # and override kpackage if we discover the right properties
+ kernel_opt_tag = "%s_kp" % (node.hostname)
+ if kernel_opt_tag in node.tag_names():
+
@ -19,8 +22,6 @@
+ kdict = dict(kparam.split('=') for kparam in kparams)
+ if 'kernel_package' in kdict:
+ kpackage = kdict['kernel_package']
+ else:
+ kpackage = BootResource.objects.get_kpackage_for_node(node)
+
if kpackage:
kernel_config = {