def list_running():
 ret = []
 for line in _machinectl('list')['stdout'].splitlines():
  try:
   ret.append(line.split()[0])
  except IndexError:
   pass
 return sorted(ret)

def list_running ( ) : ret = [ ] for line in _machinectl ( 'list' ) [ 'stdout' ] . splitlines ( ) : try : ret . append ( line . split ( ) [ 0 ] ) except IndexError : pass return sorted ( ret )
lists running nspawn containers .