fix: failed to render preseed with kernel flags (not k=v)

When using tags with kernel_opts that contain standalone flags (e.g.
debug, rcu_nocb_poll, etc.), or anything not of the form param=value,
deployments fail with the following error:

Failed to render preseed: dictionary update sequence element #x has
length 1; 2 is required

This patchset accommodates these kernel flags, and also params with
multiple '=' signs (root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

Change-Id: I14cf1ca1e6a23e5fedf61e4a6b57bbc57cafc971
This commit is contained in:
Sphicas, Phil (ps3910) 2019-10-05 19:32:23 -07:00
parent a8887a93b4
commit 06f63cc415

View File

@ -19,7 +19,7 @@
+ # parse the string and find our package param value
+ # e.g. kernel_package=linux-image-4.15.0-34-generic
+ kparams = kernel_opts.split()
+ kdict = dict(kparam.split('=') for kparam in kparams)
+ kdict = dict(kparam.split('=',1) for kparam in kparams if '=' in kparam)
+ if 'kernel_package' in kdict:
+ kpackage = kdict['kernel_package']
+