'Combine CLI options for kernel_list, cmdline, and config_list
into a list of dictionary entries (the RPC requires version,
with optional entries for config_file and cmdline).
If a config_list is specified, it must have the same number of
entries as the kernel_list.
If a cmdline is specified, it will be associated with each entry
in the kernel_list'

def _get_kernel_data(self, kernel_list, cmdline, config_list=None):

    configs = []
    versions = []
    if config_list:
        for config in re.split('[,    ]+', config_list):
            if (not config):
                continue
            if (config.lower() == 'none'):
                configs.append(None)
            else:
                configs.append(config)
    for version in re.split('[,    ]+', kernel_list):
        if (not version):
            continue
        versions.append(version)
        if (config_list is None):
            configs.append(None)
    if (len(configs) != len(versions)):
        self.invalid_syntax('Must    specify    same    number    of    entries    in    --kernel    and    --kernel-config    options')
    kernels = []
    for (version, config) in zip(versions, configs):
        kernel_info = {'version': version}
        if config:
            kernel_info['config_file'] = config
        if cmdline:
            kernel_info['cmdline'] = cmdline
        kernels.append(kernel_info)
    return kernels
