diff --git a/cobbler/tftpgen.py b/cobbler/tftpgen.py index df949d67ad..d72d588f5d 100644 --- a/cobbler/tftpgen.py +++ b/cobbler/tftpgen.py @@ -651,6 +651,7 @@ def build_kernel_options(self, system, profile, distro, image, arch, append_line = "" kopts = blended.get("kernel_options", dict()) + kopts = utils.revert_strip_none(kopts) # since network needs to be configured again (it was already in netboot) when kernel boots # and we choose to do it dinamically, we need to set 'ksdevice' to one of diff --git a/cobbler/utils.py b/cobbler/utils.py index 0bacf82fb5..3e04d13eff 100644 --- a/cobbler/utils.py +++ b/cobbler/utils.py @@ -1947,6 +1947,28 @@ def strip_none(data, omit_none=False): return data # ------------------------------------------------------- +def revert_strip_none(data): + """ + Does the opposite to strip_none + """ + if isinstance(data, str) and data.strip() == '~': + return None + + if isinstance(data, list): + data2 = [] + for x in data: + data2.append(revert_strip_none(x)) + return data2 + + if isinstance(data, dict): + data2 = {} + for key in data.keys(): + data2[key] = revert_strip_none(data[key]) + return data2 + + return data + +# ------------------------------------------------------- def lod_to_dod(_list, indexkey):