code: def _kernel_versions_redhat():
      '''
      Name of the last installed kernel, for Red Hat based systems.
  
      Returns:
              List with name of last installed kernel as it is interpreted in output of `uname -a` command.
      '''
      kernel_get_last = __salt__['cmd.run']('rpm -q --last kernel')
      kernels = []
      kernel_versions = []
      for line in kernel_get_last.splitlines():
          if 'kernel-' in line:
              kernels.append(line)
  
      kernel = kernels[0].split(' ', 1)[0]
      kernel = kernel.strip('kernel-')
      kernel_versions.append(kernel)
  
      return kernel_versionf _kernel_versions_redhat():
      '''
      Name of the last installed kernel, for Red Hat based systems.
  
      Returns:
              List with name of last installed kernel as it is interpreted in output of `uname -a` command.
      '''
      kernel_get_last = __salt__['cmd.run']('rpm -q --last kernel')
      kernels = []
      kernel_versions = []
      for line in kernel_get_last.splitlines():
          if 'kernel-' in line:
              kernels.append(line)
  
      kernel = kernels[0].split(' ', 1)[0]
      kernel = kernel.strip('kernel-')
      kernel_versions.append(kernel)
  
      return kernel_versions
docs: Name of the last installed kernel, for Red Hat based systems.
  
      Returns:
              List with name of last installed kernel as it is interpreted in output of `uname -a` command.