def lsmod():
 ret = []
 for line in __salt__['cmd.run']('kldstat').splitlines():
  comps = line.split()
  if (not (len(comps) > 2)):
   continue
  if (comps[0] == 'Id'):
   continue
  if (comps[4] == 'kernel'):
   continue
  ret.append({'module': comps[4][:(-3)], 'size': comps[3], 'depcount': comps[1]})
 return ret

def lsmod ( ) : ret = [ ] for line in __salt__ [ 'cmd.run' ] ( 'kldstat' ) . splitlines ( ) : comps = line . split ( ) if ( not ( len ( comps ) > 2 ) ) : continue if ( comps [ 0 ] == 'Id' ) : continue if ( comps [ 4 ] == 'kernel' ) : continue ret . append ( { 'module' : comps [ 4 ] [ : ( - 3 ) ] , 'size' : comps [ 3 ] , 'depcount' : comps [ 1 ] } ) return ret
return a dict containing information about currently loaded modules cli example: .