Changes from Version 1 of YumCodeSnippet/GetKernelPackageVersion

Show
Ignore:
Author:
james (IP: 65.172.155.230)
Timestamp:
10/05/11 20:14:34 (6 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • YumCodeSnippet/GetKernelPackageVersion

    v0 v1  
     1This is how you find out what kernel yum thinks you are running: 
     2 
     3{{{ 
     4  import yum 
     5  from rpmUtils.transaction import initReadOnlyTransaction 
     6 
     7  ts = initReadOnlyTransaction() 
     8  print yum.misc.get_running_kernel_pkgtup(ts) 
     9}}} 
     10 
     11...or, with less imports and more yum: 
     12 
     13{{{ 
     14  import yum 
     15 
     16  yb = yum.YumBase() 
     17  ts = yb.rpmdb.readOnlyTS() 
     18  print yum.misc.get_running_kernel_pkgtup(ts) 
     19}}}