The python library 'kmod' is included with libkmod, lets try to use that
if the user isn't utilizing kmodpy.
Signed-off-by: Tony Asleson <tasleson@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
except kmod.KmodError:
pass
except ImportError:
- pass
+ # Try the ctypes library included with the libkmod itself.
+ try:
+ import kmod
+ kmod.Kmod().modprobe(modname)
+ except Exception as e:
+ pass
def _list_subsystems(self):
self._check_self()