Version 2 (modified by james, 9 years ago)
change my to yb, for consistency

Search for which package(s) own a file on the system

yb = yum.YumBase()
pkgs = yb.rpmdb.whatProvides('/boot/vmlinuz-2.6.23.9-85.fc8', None, (None, None,None))
for pkg in pkgs:
    print pkg