def _kernel_versions_redhat():
 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

def _kernel_versions_redhat ( ) : 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
name of the last installed kernel .